flemingmike Posted September 19, 2010 Share Posted September 19, 2010 hello, if im inserting to database from form, im getting an error, but it is correctly entering the data. any ideas? <?php include 'config.php'; $query = mysql_query("INSERT INTO jobNO ( `ID` , `jobNO` , `companyID` ) VALUES ( NULL, '$_POST[jobNO]', '$_POST[companyID]' )"); mysql_query($query) or die('Error, insert query failed'); echo "1 record added"; ?> Link to comment https://forums.phpfreaks.com/topic/213784-mysql-wrong-error/ Share on other sites More sharing options...
Pikachu2000 Posted September 19, 2010 Share Posted September 19, 2010 You're actually executing mysql_query() twice. The second one (the only one that is checked for failure) tries to execute the result resource of the first one, and fails. Link to comment https://forums.phpfreaks.com/topic/213784-mysql-wrong-error/#findComment-1112697 Share on other sites More sharing options...
flemingmike Posted September 19, 2010 Author Share Posted September 19, 2010 thanks i made it $query = "Insert..... it works Link to comment https://forums.phpfreaks.com/topic/213784-mysql-wrong-error/#findComment-1112698 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.