PHP Classes

i can't running mysql stored procedure in php 5

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  i can't running mysql stored...  
Subject:i can't running mysql stored...
Summary:i can't running mysql stored procedure in php 5
Messages:4
Author:angga
Date:2009-07-07 08:24:32
Update:2009-07-07 19:14:50
 

  1. i can't running mysql stored...   Reply   Report abuse  
Picture of angga angga - 2009-07-07 08:26:12
function queryTable($sql)
{
global $serverC;
global $userC;
global $passC;
global $dbC;

$mysqli = new mysqli($serverC,$userC,$passC,$dbC);

if($mysqli->connect_errno)
{
return $mysqli->connect_error;
exit();
}

$table = array();
if ($result = $mysqli->query($sql))
{
$numResult = $result->num_rows;
if($numResult > 0)
{
$i = 0;
while($table[$i] = $result->fetch_array(MYSQLI_NUM))
$i++;
unset($table[$i]);
}
$result->close();
}
$mysqli->close();

return $table;
}

function selectBuku()
{
$sql = "call sp_selectBuku()";
return queryTable($sql);
}


$table = selectBab ();
echo count($table);
echo "<br/>";
foreach($table as $row)
{
?>
<div class="post">
<p><?=$row[4]?></p>
</div>
<?
}
?>
in my localhost(my own server) mysqli work and not in my website(Web Hosting Providers).

Could you help me with direction how I can make this work.

thanks, angga

There are 3 replies in this thread, which are not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.