$table = "alabama";
$sql = "SELECT distinct zip FROM {$table} where zip is not null order by zip;";
$sql .= "SELECT distinct city FROM {$table} where city is not null order by city;";
$sql .= "SELECT distinct county FROM {$table} where county is not null order by county;";
$mysqli = new MySQLI('host','user','pass','db');
if ($mysqli->multi_query($sql)) {
do {
if ($result = $mysqli->store_result()) {
while ($row = $result->fetch_row()) {
echo($row[0]);
}
$result->close();
}
if ($mysqli->more_results()) {
echo ("next result");
}
} while ($mysqli->next_result());
}
$mysqli->close();
The above works great now the issue is using the same sql in a stored procedure (tested stored procedure works good in command line). If I replace the sql string as
$sql = "CALL {$table}_zip();";
$sql .= "CALL {$table}_city();";
$sql .= "CALL {$table}_county();";
then the above script does not give results.
I even tested with a single stored procedure call it it does not give results.
check the privilge on
procs_privcolumn granted for the in mysql database -> http://dev.mysql.com/doc/refman/5.1/en/grant-table-structure.html