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
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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.