AncientSage Posted August 2, 2006 Share Posted August 2, 2006 Hello,I'm attempting to put variables into a column, but it appears to be giving me problems: [code]INSERT INTO file (id, song_filename, song_name, song_author, song_genre) VALUES ('', $file, $name, $type, $description);[/code]Yeah, it's telling me "unknown column *putvalueof$filehere* in" It's thinking the variables are columns, how would I get around this? Link to comment https://forums.phpfreaks.com/topic/16355-inserting-variables-into-sql/ Share on other sites More sharing options...
king arthur Posted August 2, 2006 Share Posted August 2, 2006 If they are string variables you need to enclose them in quotes.[code]INSERT INTO file (id, song_filename, song_name, song_author, song_genre) VALUES ('', '$file', '$name', '$type', '$description');[/code] Link to comment https://forums.phpfreaks.com/topic/16355-inserting-variables-into-sql/#findComment-68024 Share on other sites More sharing options...
AncientSage Posted August 2, 2006 Author Share Posted August 2, 2006 Ah, that would explain it. Thanks. Link to comment https://forums.phpfreaks.com/topic/16355-inserting-variables-into-sql/#findComment-68051 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.