Jump to content

what's wrong with this?


roseplant

Recommended Posts

Am I retarded or just tired? Why is this query returning an error?

[code]INSERT INTO stats (visit-date,visit-ip,visit-refer,visit-page,visit-useragent) values (NOW(),'134.226.111.111','','/scripts/stats.php','Mozilla');[/code]

phpadmin says: "#1064 - 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 '-date,visit-ip,visit-refer,visit-page,visit-useragent) values ( "
Link to comment
Share on other sites

[code]Database, table, index, column, and alias names are identifiers. If an identifier is a reserved word or contains special characters, you must quote it whenever you refer to it. Special characters are those outside the set of alphanumeric characters from the current character set, ‘_’, and ‘$’. [/code]
Good call... I had no idea, since I always use underscores at a matter of habit. Funny that you can use a dollar sign, though! Guess using operators in identifiers is always a bad idea...
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.