Update where: LOSING MY MIND!
Ok I keep getting an error for this that says my syntax is wrong near "order=7". If I change it to any other column than "order", it works perfectly fine. What could possibly make that happen? This is driving me insane! Heres the code:
I cant figure this out...
$uid = $_SESSION['id'];
$title = $_POST['title'];
$noteid = $_POST['tnum'];
$request = "UPDATE notes SET title='$title' WHERE (user=$uid AND order=$noteid)";
$query = mysql_query($request) or die(mysql_error());
echo "FFAILURE!!! - ".$request;
What does your table look like? In particular what type of field is order?
also, try throwing some single quotes and backticks up. sometimes theres weird glitches:
$request = "UPDATE `notes` SET `title`='$title' WHERE `user`=$uid AND `order`='$noteid'";
Wow... thanks. I don't know what the problem was, but I guess the backticks did it. Speaking of which what do they do? I'd never heard of using them. I actually had to look at my keyboard to find the key for them. haha
well it is not weird glitches...
it is just that the work order is a reserved keyword in sql language ( reserved for ordering results ) ..
i am not sure about mysql (i suppose that is what you use), but in mssql you can always use field names with 
so and order = $noteid should be and [order] = $noteid
good call gabriele. and yeah, for mysql thats the use of the back tick `
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread