mysql - Why can't I insert file path into DB or store image? PHP
647
Solution:
Insert query syntax is
INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...)
Write Column inside()
$query= "INSERT INTO posts (`post_image`) VALUES ('$image')";
^^^^ ^^^
NOTE:- mysql is deprecated instead use mysqli Or PDO
Answer
Solution:
update your insert query:
Also print this query to check whether $image has value or not.
Answer
Solution:
You can use this code
Answer
Solution:
Here is a sample of upload i tested and it works
php code
If this is not working then check your database connection
NOTE:- mysql is deprecated instead use mysqli Or PDO