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', '[email protected]', '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
https://forums.phpfreaks.com/topic/15294-simple-mysql-problem/
Share on other sites

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.