[thelist] MySQL insert fails

Joel Canfield joel at spinhead.com
Sun Jul 7 18:56:01 CDT 2002

I can't figure out why this fails:

$result = mysql_query('INSERT INTO music (id, title, artist, album, genre,
year, rating) VALUES (NULL, \"$title\", \"$artist\", \"$album\", \"$genre\",
$year, $rating)',$db);

I've tried it with single quotes around the statement with escaped double
quotes around the variables, with no quotes around the variables, etc etc.

Am I even on the right track?

I've been connecting to the db okay, so I don't suspect a
connection/permissions problem. When I echo the variables, they all have
values that make sense.


guess who think's he's learning PHP and MySQL?

More information about the thelist mailing list