PHP gevorderde |
|
$tablearray = ('tabelnaam1', 'tabelnaam2', 'tabelnaam3');
$t = 0;
foreach ($tablearray as $var){
$query = mysql_query("SELECT veldnamen FROM".$var." WHERE
zoekquery enz") or die (mysql_error());
while ($searcharr = mysql_fetch_assoc($query)){
$searchresults[$t]['title'] = $searcharr["title"];
$searchresults[$t]['text'] = $searcharr['text'];
}
$t++;
}
$tablearray = ('tabelnaam1', 'tabelnaam2', 'tabelnaam3'); $t = 0; foreach ($tablearray as $var){ $query = mysql_query("SELECT veldnamen FROM".$var." WHERE $searchresults[$t]['title'] = $searcharr["title"]; $searchresults[$t]['text'] = $searcharr['text']; } $t++; }
Ik hoop dat je dit voorbeeld snapt |