class
MySQL {
var $Error = 0; // Letzte Datenbank-Fehlermeldung
var $DB_ID = 0;
var $DBName = 0; // Letzter Datenbank-Name
function
MySQL($hostname, $port,$username,$password) {
$this->DB_ID = mysql_connect("$hostname","$username","$password")
or die($this->error = "Keine Verbindung mit dem
MySQL Server möglich");
echo $this-> error;
return $this->error;
}
function SelectDB($
db) {
$this -> DBNAme = $
db;
mysql_select_db($
db, $this->DB_ID) or die ($this->error = "Die Datenbank $
db existiert nicht");
echo $this-> error;
return $this->error;
}
function
Query($
query) {
return MYSQL_QUERY($
query, $this->DB_ID);
// echo $this-> error;
// return $this->error;
}
function FetchArray($
query) {
//$
sql = MYSQL_QUERY($
query) or die ($this->error = mysql_error());
[b] return mysql_fetch_array($
query, $this->DB_ID); [/b]// hier kommt der Fehler
}
function CloseConnection() {
return mysql_fetch_array($this->DB_ID);
}
//********************************************************************/
$
db = new
MySQL($hostname, $port, $username, $password);
$
db->SelectDB($dbName);
$
query = $
db->
Query("SELECT * FROM editor_smilies ORDER BY smilies_id DESC");
$SmilieTbl = " <table>\n";
while($inhalt = $
db->FetchArray($
query)) {
if (bcmod($i, 4) == 0) {
$SmilieTbl = $SmilieTbl." </tr>\n <tr align=\"center\" valign=\"middle\">\n";
}
$SmilieTbl = $SmilieTbl." <td><a href=\"javascript
:emoticon('".$inhalt[ code ]."')\"><img src=\"../../images/smilies/".$inhalt[smile_url]."\" vspace=\"5\" hspace=\"5\" border=\"0\" alt=\"".$inhalt[emoticon]."\" title=\"".$inhalt[emoticon]."\" /></a></td>";
$i++;
}
$SmilieTbl = $SmilieTbl." </tr></table> \n";