Mutley Posted May 26, 2008 Share Posted May 26, 2008 Is there any reason why this won't work? <?php $sql_three = " INSERT INTO `own` (own_id, user_id, prod_id, damage, loadout, market_id, slot) VALUES ('', '$user_id', '15', '0', '1', '0', '1'); INSERT INTO `own` (own_id, user_id, prod_id, damage, loadout, market_id, slot) VALUES ('', '$user_id', '29', '0', '1', '0', '3'); INSERT INTO `own` (own_id, user_id, prod_id, damage, loadout, market_id, slot) VALUES ('', '$user_id', '34', '0', '1', '0', '5') "; mysql_query($sql_three); ?> It only puzzles me because when I echo the SQL or copy the code and paste it into phpMyAdmin it works flawlessly. Thanks, Nick. Link to comment https://forums.phpfreaks.com/topic/107332-solved-simple-query-wont-work/ Share on other sites More sharing options...
BlueSkyIS Posted May 26, 2008 Share Posted May 26, 2008 resource mysql_query ( string query [, resource link_identifier] ) mysql_query() sends an unique query (multiple queries are not supported) to the currently active database on the server that's associated with the specified link_identifier. Link to comment https://forums.phpfreaks.com/topic/107332-solved-simple-query-wont-work/#findComment-550302 Share on other sites More sharing options...
Gamic Posted May 26, 2008 Share Posted May 26, 2008 <?php $sql_three[]= "INSERT INTO `own` (own_id, user_id, prod_id, damage, loadout, market_id, slot) VALUES ('', '$user_id', '15', '0', '1', '0', '1');"; $sql_three[]= "INSERT INTO `own` (own_id, user_id, prod_id, damage, loadout, market_id, slot) VALUES ('', '$user_id', '29', '0', '1', '0', '3');"; $sql_three[]= "INSERT INTO `own` (own_id, user_id, prod_id, damage, loadout, market_id, slot) VALUES ('', '$user_id', '34', '0', '1', '0', '5');"; foreach ($sql_three as $key=>$value){ mysql_query($value); } ?> Link to comment https://forums.phpfreaks.com/topic/107332-solved-simple-query-wont-work/#findComment-550309 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.