chiprivers Posted March 19, 2007 Share Posted March 19, 2007 This following piece of script is driving me nuts ??? <?php $get_meeting = "SELECT m.meetingID FROM meetings AS m WHERE m.venueREF = ".$venue_venueid[$venue]." AND m.m_date = ".$date; echo $get_meeting; $got_meeting = mysql_fetch_array($get_meeting); if (mysql_num_rows($got_meeting) == 0) { $insert_meeting = "INSERT INTO meetings (venueREF,m_date) VALUES (".$venue_venueid[$venue].",'".$date."')"; $inserted_meeting = mysql_query($insert_meeting); } ?> This piece of script is part of a loop and during each run of the loop it checks to see if there is a record in the database for the values generated, if there is not, it creates a new entry. As it is running at the moment, it keeps adding a new entry each cycle !! ?? Can any body spot a problem? Link to comment https://forums.phpfreaks.com/topic/43392-pulling-my-hair-out-with-this-one/ Share on other sites More sharing options...
bwochinski Posted March 19, 2007 Share Posted March 19, 2007 You'll need to use a mysql_query() in there somewhere before your if statement... Link to comment https://forums.phpfreaks.com/topic/43392-pulling-my-hair-out-with-this-one/#findComment-210738 Share on other sites More sharing options...
chiprivers Posted March 19, 2007 Author Share Posted March 19, 2007 You'll need to use a mysql_query() in there somewhere before your if statement... Now I feel stupid, the mysql_fetch_array() supposed to be a mysql_query() doh! Thanks! Link to comment https://forums.phpfreaks.com/topic/43392-pulling-my-hair-out-with-this-one/#findComment-210739 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.