In my PHP code, I want to execute the following two commands:
use mydb;
select * from mytbl;
Now, I can get it work with the following statements:
$SQL = "use mydb";
$result = mysql_query($SQ L );
$SQL = "select * from mytbl";
$result = mysql_query($SQ L );
What I really wan to do is "something" like:
$SQL = "use mydb ";
$SQL .= "select * from mytbl;";
$result = mysql_query($SQ L );
i. e. I want to concatenate the two statement and execute the query only
once.
Is there a way to do this with mysql_query (or with someother function)?
Thanks...
use mydb;
select * from mytbl;
Now, I can get it work with the following statements:
$SQL = "use mydb";
$result = mysql_query($SQ L );
$SQL = "select * from mytbl";
$result = mysql_query($SQ L );
What I really wan to do is "something" like:
$SQL = "use mydb ";
$SQL .= "select * from mytbl;";
$result = mysql_query($SQ L );
i. e. I want to concatenate the two statement and execute the query only
once.
Is there a way to do this with mysql_query (or with someother function)?
Thanks...
Comment