MySQL Forums
Forum List  »  Stored Procedures

Re: Calling stored procedure from PHP
Posted by: Markus Popp
Date: June 20, 2005 05:10AM

Now it works :-) ... thanks! It's some quite complicated syntax (compared to what I'm used to), but the important thing is that it works.

Here's a little example:

<table>
<tr>
<th>Name</th>
<th>Continent</th>
<th>Language</th>
<th>isOfficial</th>
<th>percent</th>
<th>PeopoleSpeaking</th>
</tr>
<?php
$sql = "call getLang()";

if ($mysqli->multi_query($sql))
{
do
{
if ($result = $mysqli->use_result())
{
while ($data = $result->fetch_row())
{
echo "<tr>\n";
echo "\t<td>".$data[0]."</td>\n";
echo "\t<td>".$data[1]."</td>\n";
echo "\t<td>".$data[2]."</td>\n";
echo "\t<td>".$data[3]."</td>\n";
echo "\t<td>".$data[4]."</td>\n";
echo "\t<td>".$data[5]."</td>\n";
echo "</tr>\n";
}
$result->close();
}
} while ($mysqli->next_result());
}
?>
</table>

--
Markus Popp, Web Developer, mysql.com
Oracle Austria

Options: ReplyQuote


Subject
Views
Written By
Posted
59431
March 18, 2005 05:58PM
8441
November 26, 2008 05:09AM
22271
April 25, 2005 01:10PM
Re: Calling stored procedure from PHP
3443
June 20, 2005 05:10AM
3973
October 22, 2006 10:03PM
4063
November 03, 2006 02:30AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.