i have this line of code which i cannot see a problem with but i keep getting an error.

$sql= "INSERT INTO emails (Firstname, Lastname, email, table) VALUES ('$a', '$b', '$c', '$table')";

the error i keep getting is

Error: You have an error in your SQL syntax near 'table) VALUES ('kevin', 'wood', 'kevin_wood@xxxxxxxx', 'news')' at line 1

the values are being passed to this page fine but it still gives me this error.

any help would be much appreciated.

Recommended Answers

All 5 Replies

table = mysql reserve keyword.

Use `table` instead.

commented: always very helpfull and gives good answers +2

thanks for the reply nav33n i have been looking for missing semo colons. which is usually my problem. hope u all good ne way not been on here for a while. must say something about the help you gave me in the past.

We all learn from our mistakes! Don't we ? :) I am good. Thanks! I hope you are doing great too. Cheers man!

well i still got my job so i cannot be doing that bad. thanks again take it easy and have fun.

Cool ! You too..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.