| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: May 2004
Posts: 1,812
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
| | |
| | THREAD STARTER #3 (permalink) | ||||
| Senior Member Join Date: May 2004
Posts: 1,812
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
(long join query) while ($row = mysql_fetch_array($find_them)){ $uid = $row['uid']; I need to insert the first instance/loop of uid into $recipient1 insert query, second instance/loop into $recipient2 etc etc Thanks, -Ryan | ||||
| | |
| | #5 (permalink) |
| NamePros Regular Join Date: Aug 2005 Location: NY, USA
Posts: 608
![]() ![]() ![]() ![]() ![]() ![]() | Something more like this, perhaps? $i = 0; while ($i < 5 && $row = mysql_fetch_array($find_them)){ $recipients[$i] = $row['uid']; $i++; } //... //... //echo $recipients[0] . ", " . $recipients[1] ...
__________________ ask me about the internet |
| | |
| | THREAD STARTER #6 (permalink) |
| Senior Member Join Date: May 2004
Posts: 1,812
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Thanks guys Almost there, View Code The UPDATE leads query within the foreach loops is running twice as much as it should. The $find_the query is producing 2 $uid's and the querys in the foreach are running 4 times, so the $recipient1 and 2 is set to the first $uid and recipient3 and 4 is set to the second $uid. Which is a big problem. Any ideas? Thanks, -Ryan ---------- Post added at 06:05 PM ---------- Previous post was at 04:42 PM ---------- Okay, for those interested, here is how I got it to work: ????: NamePros.com http://www.namepros.com/showthread.php?t=617511 for ($val1 = each($uid), $val2 = each($bid); $val1 || $val2; $val1 = each($uid), $val2 = each($bid)) { query goes here calling on the values like $val1[1] and $val2[1] }
Last edited by DJ-Sound; 10-19-2009 at 01:58 PM.
|
| | |