Hi All,
I wonder if anyone can help me. I'm trying to do this :
// Connect to database
$mysql_link = mysql_pconnect("localhost", "database", "password");
// Get list of tables
$mysql_result = mysql_list_tables("takbro", $mysql_link);
// Get each table name and query it.
while ($tablename = mysql_fetch_row($mysql_result)) {
$real_tablename = (eregi_replace("\_.*.$","","$tablename[0]"));
$query = "select * from $tablename[0] where category like '%".$searchterm."%'";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
if ($num_results == "0" ) {
break;
}
print "The $real_tablename range has $num_results results matching <b>$searchterm</b>\n";
// Other Stuff Happens.....
}
So basically, the script executes, grabs a list of tables, and then checks for results. I want to jump round to the next loop if $num_results == 0. In perl, I'd just use a next statement, but I can't seem to find a similar thing, and break; just halts all execution (in this case). Help ! Deadline Looming !
TIA
James.