Apache 2.2
php 5.1.4
mysql 5.0
Win XP SP2
Code:
<?
$mysqli = new mysqli('localhost','root','admin');
$mysqli->select_db('demo');
$result = $mysqli->query("SELECT * FROM members");
while($row = $result->fetch_assoc()) {
print $row['firstName'] . ' ' . $row['lastName'] . '<br/>';
}
$result->close();
?>
<?
$mysqli = new mysqli('localhost','root','admin');
$mysqli->select_db('demo');
$result = $mysqli->query("SELECT * FROM members");
while($row = $result->fetch_assoc()) {
print $row['firstName'] . ' ' . $row['lastName'] . '<br/>';
}
$result->close();
?>
Uvek izbaci : Fatal error: Call to a member function fetch_assoc() on a non-object in c:\webs\test\testmysql5.php on line 8
Zasto?
Shoot for the moon. Even if you miss, you'll land among the stars.
Les Brown
Les Brown