mam błąd
Fatal error: Class 'mysqli' not found in db.class.php on line 11
a to obecny kod
<?php
class database {
var $connection;
/* Creates a connection with the database.
@param string: database name
*/
function database ($name) {
$this->connection = new mysqli('localhost',$name,'root','');
if (mysql_connect_errno()) {
echo '<p class="error">Error: Connection with database ' . $name . ' failed.</p>';
}
}
/* Executes queries.
@param string: sql query
*/
function execute($sql) {
$result = $this->connection->query($sql);
return $result;
// $zmienna = $db->execute("SELECT ...");
// pozniej pobieram $wynik = $zmienna->fetch_object();
}
/* Disconnnects with the database.
*/
function disconnect() {
$this->connection->close();
}
}
$db = new database('comicsite');
//$db->execute("SELECT * FROM cms_users");
$db->disconnect();
?>
co robie zle?