Basically, when the code below runs it'll output this...How come the bussID: XXXX loop only runs for the first one, and not for each of the userID: xxxx? If that makes sense? I need to check each userID against the bussIDs...and if they match it'll echo "woo" (well, in real life it'll do something better, but for testing that's fine!)
userID: 3193
bussID: 3223
bussID: 3226
bussID: 3243
bussID: 3193 woo
bussID: 3242
bussID: 3196
bussID: 3241
bussID: 3240
bussID: 3238
bussID: 3239
bussID: 3221
bussID: 3220
bussID: 3217
bussID: 3218
bussID: 3224
bussID: 3225
bussID: 3222
bussID: 3219
userID: 3221
userID: 3219
userID: 3193
bussID: 3223
bussID: 3226
bussID: 3243
bussID: 3193 woo
bussID: 3242
bussID: 3196
bussID: 3241
bussID: 3240
bussID: 3238
bussID: 3239
bussID: 3221
bussID: 3220
bussID: 3217
bussID: 3218
bussID: 3224
bussID: 3225
bussID: 3222
bussID: 3219
userID: 3221
userID: 3219
PHP:
//let's get all the user IDs from the users table
while($result = mysql_fetch_array($query)){
echo "<br/>userID: $result[id] ";
echo"<br/><br/><br/>"; //TRIAL FORMATTING ONLY - REMOVE LATER
//Get the bussIDs and do any of these IDs match any of the bussIDs in the other services table?
while($extraServicesResult = mysql_fetch_array($extraServices)){
echo "<br/>bussID: $extraServicesResult[bussid] ";
//if they do, let's output the data for that company
if($extraServicesResult[bussid] == $result[id]){
echo"woo"; // include('advanceincludes/bussinfo.php'); (correct output when all working)
}
}//end of while($extraServicesResult
echo"<br/><br/><br/>"; //TRIAL FORMATTING ONLY - REMOVE LATER
}
Last edited:
















