rn14 Posted February 21, 2007 Share Posted February 21, 2007 Im trying to pass the values returned to the variable $to so that a message is sent to each number individualy but it only sends it to one number not them all $query = "SELECT `mobile` FROM `customer`"; $result = mysql_query($query) or die(mysql_error()); $number = array(); while(list($mobile) = mysql_fetch_row($result)) { $number[] = $mobile; } // Test it foreach($number as $mobile) { echo $mobile . "<br>"; } $user = "xxxx"; $password = ""; $api_id = ""; $baseurl ="http://api.clickatell.com"; $text = $_POST['text']; $to = $mobile; Link to comment https://forums.phpfreaks.com/topic/39487-database-loop/ Share on other sites More sharing options...
Jessica Posted February 21, 2007 Share Posted February 21, 2007 what happens if you do print_r($number); Link to comment https://forums.phpfreaks.com/topic/39487-database-loop/#findComment-190517 Share on other sites More sharing options...
rn14 Posted February 21, 2007 Author Share Posted February 21, 2007 It prints out the values. I think im overlaying the previously stored value in the $to variable each time through the loop? Link to comment https://forums.phpfreaks.com/topic/39487-database-loop/#findComment-190578 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.