I have created the MySql procedure which create multiple tables and insert data, and if data do not current then remove it and show the messages in mysql command line or my sql workbench.. For this i used variable and then display like following it is working fine in mysql.
SET _output = 'Generating table one...';
select _output;
create table ec_ms_yy_qt
(select * from table1);
call checkdata();
SET _output = 'Generating table tow..';
select _output;
If i called same from php it stop after first statement and do not execute the procedure. It only return 'Generating table one...'; . It mean stop running if found the select statement
$rs = mysql_query( ‘CALL processdata()’ );
while($row = mysql_fetch_assoc($rs))
{
print_r($row);
}
Then I removed the select _output from store procedure it working fine. But this is not solution i want , user will not informed by any error occur and where it was raised. It also hanged the program till procedure finished and browse show on status bar waiting for localhost.
mysql_query()may only be able to fetch the rows from the first query. Everything else runs, you just can't get those rows.