mysql_query(INSERT...

I have problems with the right Syntax putting data to a sql table.

For example i have the variables

$name
$age
$gender

and the fields

id (autoincrement)
name
age
gender
comment

now i want to store the variables into the table customer

what is the right syntax ?

mysql_query("INSERT INTO customer ('name','age','gender')
VALUES ($name,$age,$gener)");

doesnt work.

greetings

Thalia


Comments

  • mysql_query ("INSERT INTO customer (name,age,gender) VALUES ('$name','$age','$gender')");

    also, spell gender with a "d" ;-)



    : mysql_query("INSERT INTO customer ('name','age','gender')
    : VALUES ($name,$age,$gener)");
    :
    : doesnt work.
    :
    : greetings
    :
    : Thalia
    :
    :
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://mark.space.servehttp.com

  • No it works :-)

    Thx a lot.

    Thalia

    : mysql_query ("INSERT INTO customer (name,age,gender) VALUES ('$name','$age','$gender')");
    :
    : also, spell gender with a "d" ;-)
    :
    :
    :
    : : mysql_query("INSERT INTO customer ('name','age','gender')
    : : VALUES ($name,$age,$gener)");
    : :
    : : doesnt work.
    : :
    : : greetings
    : :
    : : Thalia
    : :
    : :
    : :
    :
    : [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    : url--> http://mark.space.servehttp.com
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories