webguy262 Posted July 2, 2009 Share Posted July 2, 2009 I'm wondering why... $query = "INSERT INTO emails (email) VALUES ('$email') or die(mysql_error())"; $result = mysql_query($query); Does not work... $query = "INSERT INTO emails (email) VALUES ('$email') or die(mysql_error())"; mysql_query($query); Does work. I thought both would work... what am I missing? Link to comment https://forums.phpfreaks.com/topic/164555-executing-an-insert/ Share on other sites More sharing options...
mattal999 Posted July 2, 2009 Share Posted July 2, 2009 Well neither SHOULD work, because they both use incorrect syntax. Should be: $query = "INSERT INTO emails (email) VALUES ('$email')"; $result = mysql_query($query) or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/164555-executing-an-insert/#findComment-867969 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.