Barand Posted March 19, 2007 Share Posted March 19, 2007 That's what the manual is for http://www.php.net/get_magic_quotes_gpc http://www.php.net/mysql_real_escape_string http://www.php.net/strip_tags Link to comment https://forums.phpfreaks.com/topic/43372-quick-sql-question/page/2/#findComment-210748 Share on other sites More sharing options...
leisnerr Posted March 19, 2007 Author Share Posted March 19, 2007 Okay, I have some reading to do to get into it a little more advanced. But what was the problem with the code I wrote? Could you point out where my error is? I'm gonna try to learn as much as I can but I'm starting with w3s lol. Thanks. Link to comment https://forums.phpfreaks.com/topic/43372-quick-sql-question/page/2/#findComment-210844 Share on other sites More sharing options...
Barand Posted March 20, 2007 Share Posted March 20, 2007 mysql_query("INSERT INTO Person (FirstName, LastName, Age) VALUES ('$_POST[firstname]', '$_POST[lastname]', '$_POST[age]')"); if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "Information Added"; $sql is not defined. In my version I define $sql then call mysql_query(). You call mysql_query() then try to call it again with an undefined query string Link to comment https://forums.phpfreaks.com/topic/43372-quick-sql-question/page/2/#findComment-210850 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.