Jump to content

loop help please!


pwdrskier4

Recommended Posts

Hi, I am having trouble with this. I have two tables that both have a primary key named 'myid'. Basically, I am trying to loop through the rows of the first table and check to see if a row with the primary key of the same value exist in the second table. Here is what I have so far but it is not working properly.


[code]<?php

do {
$check = $row_Recordset1['table1_id'];
if ($row_Recordset2['table2_id'] == $row_Recordset1['table1_id']){
echo "$check exists in table 2<br />";

}
else {echo "$check does not exist in table 2<br />";}
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));

echo "<br />Done <br />";
?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/10810-loop-help-please/
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.