 |
when i try to update the data in a csv file into mysql database im
getting these following errors,can u guys help me out
UPDATE into
'td_demo'('Vehicle_description','Status','Conditions',
'Wholesale','Pickup_Location','Year','VIN','Make','Body_Style','Model','Doors','Trim_Level','Vehicle_Type','Odometer','Salvage','As_Is','Fuel_Type','Title_State','Engine','Title_Status','Displacement','Drive_Train',
'Transmission','Interior_Type','Exterior_Color','Top_Type','Interior_Color','Stereo','Window_Sticker','Airbags','Equipments','Image_directory')
values('2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','')
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'into 'td_excel'('Vehicle_description','Status','Conditions',
'Wholesale','Pickup' at line 1**
|
 |
I have this line of SQL:
$sql = "SELECT ID, ListStID, ListEmail, Title FROM
$entry_database WHERE ID = '". $ReqBookID ."'";
$result = mysqli_query($conn, $sql);
As you can see, I am selecting an entry's ID, ListStID, ListEmail
and Title Column if ID is equal to a string of numbers (or text),
which is given by user in a form.
Everything is ok, and I don't get any syntax error when I write the
code (I am using a code editor software. However, when I use it
online, I get this error:
Error: SELECT ID, ListStID, ListEmail, Title FROM WHERE ID = '4'
You
have an error in your SQL syntax; check the manual that corresponds
to
your MariaDB server version for the right syntax to use near 'WHERE
ID
= '4'' at line 1
I am very new to PHP, and I'm sure I am either adding extra ' or ",
so I would really appreciate it if you could help me with this issue.
I have tried the answers for similar questions, but no success
yet.
|
 |
Query failed:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have
an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near ':c2 , add=:c3 ,
mob=:c4 WHERE id=:c1' at line 1
I had a syntax error in this program,I can't update "cus" table in
database.Please anyone can solve this bug.
Thankyou
My PHP codings are below:
if(isset($_POST['submit']))
{
$c1=$_POST['cid1'];
$c2=$_POST['cname1'];
$c3=$_POST['cadd1'];
$c4=$_POST['cmob1'];
$sql1 = "UPDATE 'cus' set 'name'=':c2' , 'add'=':c3' , 'mob'=':c4'
WHERE 'id'=':c1'";
$st1=$conn->prepare($sql1);
$st1->bindParam(":c2",$c2,PDO::PARAM_STR);
$st1->bindParam(":c3",$c3,PDO::PARAM_STR);
$st1->bindParam(":c4",$c4,PDO::PARAM_STR);
$st1->bindParam(":c1",$c1,PDO::PARAM_INT);
$st1->execute();
header("location:frm.php");
}
|