Jump to content

Pulling my hair out with this one?!


chiprivers

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.