Ik heb een mysql connectie class gemaakt alleen hij doet het niet.
db.class.php
PHP
<?php
class db {
function connect() {
$this->conn = mysql_connect("localhost", "youri_game", "......");
mysql_select_db("youri_game", $this->conn);
}
function query($sql) {
$this->connect();
$this->results = mysql_query($sql, $this->conn);
}
function fetch_object($query) {
$result = mysql_fetch_object($query);
}
}
$db = new db;
$dbres = $db->query("SELECT * FROM `Users`");
$result = $db->fetch_object($dbres);
?>
Toon Meer
Dit is de error.
PHP
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/youri/domains/colombogame.nl/public_html/new/db.class.php on line 20
Wie ken me helpen?