cia a tutti. volevo porvi una questione semplice.
ho fatto questo breve codice; mi dite dove sbaglio:
Codice PHP:
<?php
class lastposts
{
var $hostname = "localhost";
var $username = "root";
var $password = "";
var $dbName = "my_db";
function connect_db()
{
mysql_connect($this->hostname,$this->username,$this->password)
|| die(mysql_error());
@mysql_select_db($this->dbName)
|| die("Could not connect to the database.");
}
function disconnect_db()
{
mysql_close();
}
} // End class
$obj = new lastposts;
$obj->connect_db();
$question = "SELECT * phpbb_topics WHERE forum_id =1 order by topic_id desc LIMIT 0 , 10 ";
$query = mysql_query($question);
echo ($query);
$obj->disconnect_db();
?>