TRI0N Posted May 17, 2007 Share Posted May 17, 2007 Okay here is the deal. Fist if somone selects ALL from the Recpient field of a memo form it will extract all the people in the employees database. $recpient = $_REQUEST['recpient'] ; $subject = $_REQUEST['subject'] ; $body = $_REQUEST['body'] ; $ip_record = $REMOTE_ADDR ; $from = $firstname." ".$lastname ; if ($recpient == 'ALL') { $result3 = mysql_query("SELECT distinct * FROM employees") ; while($row = mysql_fetch_row($result3)) { $recpient = $row[0] ; mysql_query("INSERT INTO memos VALUES('NULL','$date3','$time','$recpient','$from','$subject','$body','0','$ip_record')") OR die(mysql_error()); // Close Database Connection mysql_close(); } } Does this code look correct? Link to comment https://forums.phpfreaks.com/topic/51766-multi-data-insert-based-on-x-number-of-returned-recpients-php/ Share on other sites More sharing options...
TRI0N Posted May 17, 2007 Author Share Posted May 17, 2007 Well except don't put the mysql_close(); into the Loop.. Duh.. Just noticed that I did that. Link to comment https://forums.phpfreaks.com/topic/51766-multi-data-insert-based-on-x-number-of-returned-recpients-php/#findComment-255032 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.