Jump to content

Recommended Posts

mysql_query("SELECT TitleSafe FROM thebook WHERE key='".mysql_real_escape_string($bookKey)."'") or die(mysql_error());

 

Says I have a syntax error near: key='73350' key is a BIGINT don't know if that means anything to this issue, but thats the whole line throwing the error. Any ideas?

Removing the quotes didnt change anything, still get the same error.

 

who ever developed this database used key as someone would use ID, does that still hold the difference as to what you said about key being reserved? id so should I change the name of the whole column to ID or something?

Well decided to change the column name to ID,

alter the line of code as such:

mysql_query("SELECT TitleSafe FROM thebook WHERE ID=".$bookKey."") or die(mysql_error());

 

Unfortunately I still get an 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 '' at line 1

 

I have tried a couple variations of the line as well, with or without quotes, with or without mysql_real_escape_string still the same thing.

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.