Jump to content

[SOLVED] Mysql query trouble


fallenangel1983

Recommended Posts

Hey guys.

 

Can someone tell me what is up with this query. Its driving me crazy.

 

$updateevent="UPDATE events SET solved = 'Y' WHERE solID = '$solID'";

$result=mysql_query(updateevent) or die(mysql_error());

 

The table i am trying to put this in is the events table. Column solved is of TYPE VARCHAR and has a max length of 3

$solID is set to 26

There is definately a row where solID = 26 and currently the solved column reads 'N'. however when I try it..

 

I get this error:

 

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 'updateevent' at line 1

Link to comment
https://forums.phpfreaks.com/topic/99200-solved-mysql-query-trouble/
Share on other sites

here is your problem, the clue is in the error....... updateevent....

 

$updateevent="UPDATE events SET solved = 'Y' WHERE solID = '$solID'";
$result=mysql_query($updateevent) or die(mysql_error()); //you missed off the dollar sign to the query statement call

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.