[SOLVED] INSERT INTO... syntax error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dardsemail
Forum Contributor
Posts: 136
Joined: Thu Jun 03, 2004 9:02 pm

[SOLVED] INSERT INTO... syntax error

Post by dardsemail »

Hi,

I am creating a registration form and pulling the data from a POST form.

I'm trying to create an INSERT query to insert the data and am getting a syntax error. Here's the code:

Code: Select all

<?php
@mysql_query("INSERT INTO users(firstName, lastName, username,password) VALUES($frm_firstName, $frm_lastName, $frm_username, $frm_password)") OR DIE(mysql_error());

?>
Here's the error message:

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 can't seem to correctly input the syntax! Help! I've tried $_POST['$frm_firstName'] etc... but to no avail. What am I doing wrong?
dardsemail
Forum Contributor
Posts: 136
Joined: Thu Jun 03, 2004 9:02 pm

Post by dardsemail »

never mind - got it!
Post Reply