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