Re: MySQLi
<html><body>
Substitute your USR, PWD, db & query values:
<?php
$link = mysqli_connect('localhost', 'USR', 'PWD', 'sakila')
or die('Could not connect: ' . mysqli_error());
$res = mysqli_query( $link, "SELECT * FROM sakila.category" )
or die( mysqli_error($link) );
$cols = mysqli_num_fields($res);
$rows = mysqli_num_rows($res);
echo "<table><br/>";
while ($row = mysqli_fetch_array( $res )) {
echo "<tr>\n ";
for( $i = 0; $i < $cols; $i++ ) {
echo " <td>$row[$i]</td>";
}
echo "\n</tr>\n";
}
echo "</table>\n";
mysqli_close($link);
?>
</body></html>
Subject
Written By
Posted
Re: MySQLi
April 13, 2006 02:22PM
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.