Jump to content

simple mysql problem


tomfmason

Recommended Posts

lol. I feel dumb for even asking this but I am  ??? at this point.

ok here we go. I am attempting to insert some information into a database.(php 101 all over again)

here is the code

[code=php:0]$sql = mysql_query("INSERT INTO chat (first_name, last_name, email, department, status, chat_date, chat_time, chat_text, from)
       VALUES ('$first_name', '$last_name', '$email', '$department', '$status', now(), now(), '$chat_text', '$from')") or die(mysql_error());[/code]

This is the mysql error that I get.

[code]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 'from) VALUES ('testguy', 'test', 'test3@test1.com', 'Support', 'waiting'' at line 1[/code]

I am sure that this is a simple error but it is hanging me up. When I erase  [b]from[/b] from the query, it inserts just fine.

Any suggestions would be great.

thanks,
tom 
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.