Hey guys I have a doubt about "reusing" PHP arrays.
I have the following code:
do {
//html
do{
print $check_request['performanceID']."".$row_list_PerformancesAll['eventID'];
}while($check_request = mysql_fetch_assoc($check_request_issent));
//html
} while ($row_list_PerformancesAll = mysql_fetch_assoc($list_PerformancesAll));
The second loop is executed only once :S. Only on the first loop of the outter loop. From the second on it's like it loses its values. It happens with all my do while loops :S
For instance in a particular page I have to print the same table several times with the same information just different field names, the first table is printed fine but the subsequents the table just prints the first row (which is out of the loop) and has the table lables.
Is there a way to "reuse" those arrays? They are all from mysql queries and they have several other fields within itself ($check_request = 3 diff fields / $list_PerformancesAll = 7 diff fields).
I've been redoing the search for each time the first loop runs to make the script work for now:
]
do {
//html
$query = "SELECT * FROM table WHERE performanceID = $check_request['performanceID'] "
mysql_query($query);
//html
} while ($row_list_PerformancesAll = mysql_fetch_assoc($list_PerformancesAll));
I need to compare the $check_request['performanceID'] field against $row_list_PerformancesAll['eventID'], If there is a way to just use the arrays I already have it would make the website run faster.
I've been trying to use the PHP commands:
in_array(), search_array() etc... But I have to be honest I'm still learning PHP so arrays are still kind mystic to me 😛 I use Dreamweaver and it makes the job really easy but now I'm stuck 🙁
Thanks in advance to all.
Gill