Call procedure from PHP doesn't work for me, please help!!!
Posted: Thu May 25, 2006 3:55 am
Weirdan | Please use
From command like, i can see the result with: Call select_emp(), but not at browser.
I still don't understand whats wrong with my coding!
Is there any one have any idea about this?
Weirdan | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi All,
i'm new to stored procedure, i have go thru a lot of article and testing on their example.
I manage to create and call procedure from the command like. But my only problem is
when calling procedure from PHP.
Here is the coding:Code: Select all
$db = mysqli_connect('localhost', 'root', '');
if (mysqli_connect_errno())
{
print 'Error: Could not connect to database. Please try again later.';
exit;
} else {
echo "no error";
}
mysqli_select_db($db, 'testing');
//$result3 = mysqli_multi_query($db, "call select_emp()") or die(mysqli_error($db));
if($result = mysqli_multi_query($db, "call select_emp()")) {
while ($row = mysqli_fetch_array($result,MYSQLI_NUM)) {
echo $row[0];
}
mysqli_free_result($result);
echo 'good';
} else {
echo 'sucks';
}I still don't understand whats wrong with my coding!
Is there any one have any idea about this?
Weirdan | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]