URGENT: problem with insert, please help

Codes here !

Moderators: macek, egami, gesf

Godiwa
New php-forum User
New php-forum User
Posts: 40
Joined: Wed Mar 05, 2003 5:55 am

URGENT: problem with insert, please help

Postby Godiwa » Wed Mar 05, 2003 12:52 pm

Yeah I know I am a newbie, so I gotta ask Q's that might be simple to you so here goes. I get an error "Parse error: parse error, unexpected T_STRING in C:\Program Files\Apache Group\Apache2\htdocs\test.php on line 25"

when I run my page, and here is the code in line 25

Code: Select all

mysql_query(INSERT INTO stats (name,email,fillies,colts,dwarfs,angels) VALUES($name,$email,$fillies,$colts,$dwarfs,$angels))


What am I doing wrong?

all the VARs are defined at the start of the page (will get them from a form laters)

the first () is the names of the rows in the table, the table name is stats and the values are from the VARs please help me

Jesper

Godiwa
New php-forum User
New php-forum User
Posts: 40
Joined: Wed Mar 05, 2003 5:55 am

Postby Godiwa » Wed Mar 05, 2003 1:59 pm

never mind, I finally found out how to get it to work, a lot of testing, trying, fiddling and so on so here goes (just in case someone else have the same Q as me)

Code: Select all

mysql_query("INSERT INTO stats (name,email,fillies,colts,dwarfs,angels)VALUES('$name','$email','$fillies','$colts','$dwarfs','$angels')");


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 1 guest

cron