SQL error in database?
I am doing a sample project right now?I am getting this error when i am edititng the record in the database.
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 'qwer,companyname='qwer' WHERE id='15'' at line 1
Please can anyone resolve me?
thanks in advance,
can you post your code? Whole code...
I mean you are asking which code?
here i posted my search.php code
<form action="sim.php" method="get" >
<input type="text" name="k" size="100" value="<?php echo $_GET['k']; ?>" />
<input type='submit' value='search' />
$query="SELECT * FROM form";
foreach($terms as $each)
$query .="keywords LIKE '%$each%'";
$query .="OR keywords LIKE '%$each%'";
//connect th edatabase
$numrows=mysql_num_rows($query) or die(mysql_error());
echo "<h2><a href=''>$fname</a></h2>$name<br /><br />";
echo "No results found for '<b>$k</b>' ";
Please help me i am struggling now.
That error is not from that code...
You're also missing the where clause in the search.php page though. that would probably help.. but again, that's a pull query and your error is on an update which isnt in that code you posted..
Whereever that error is, it's missing a quote in the value though.. you have an unterminted value (qwer) qwer,companyname='qwer'..
it should be sqlstring...qwer', companyname='qwer' where id='15'
Thanks for ur response....Got it.....Once againg thanks.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)