Pit: mysqli: Umstellungsfehler

Beitrag lesen

Hallo,

bei der Umstellung eines Scriptes von mysql_ auf mysqli komme ich einem Fehler nicht auf die Schliche. Das Script ist ein Addon zu fpdf, das eine Liste auf einem PDF generieren soll.

Könnt Ihr mal einen Blick auf meine Umstellung werfen? Es sind insgesamt 10 umgestellte Passagen von mysql_ auf mysqli.

Da müßte irgendwo (mindestens) ein Fehler drin sein, denn ich erhalte zwar ein PDF, aber kein Ergebnis innerhalb der zu generierenden Liste.

Pit

// 1:
while($data=mysql_fetch_row($this->results)) {
while($data=mysqli_fetch_row($this->results)) {
//------------------------------------------------------------

//2:
function query($query){
	$this->results = mysql_query($query,$this->conn);
	$this->numFields = mysql_num_fields($this->results);
	$this->results = mysqli_query($this->conn,$query);
	$this->numFields = mysqli_num_fields($this->results);
}
//------------------------------------------------------------

//3:
$stringWidth = $this->getstringwidth(mysql_field_name($this->results,$i)) + 6 ;
$stringWidth = $this->getstringwidth(mysqli_fetch_field_direct($this->$result, $i)->name) + 6;
//------------------------------------------------------------

//4:
$this->colTitles[$i] = mysql_field_name($this->results,$i) ;
switch (mysql_field_type($this->results,$i)){
$this->colTitles[$i] = mysqli_fetch_field_direct($this->$result, $i)->name ;
switch (mysqli_fetch_field_direct($this->$result, $i)->type){
//------------------------------------------------------------

//5:
while($row=mysql_fetch_row($this->results)){
while($row=mysqli_fetch_row($this->results)){
//------------------------------------------------------------

//6:
if(strlen(mysql_field_name($this->results,$i))>$flength){
$flength = strlen(mysql_field_name($this->results,$i));
if(strlen(mysqli_fetch_field_direct($this->$result, $i)->name)>$flength){
$flength = strlen(mysqli_fetch_field_direct($this->$result, $i)->name);
//------------------------------------------------------------

//7:
mysql_field_name($this->results,$i),
mysql_field_type($this->results,$i),
mysqli_fetch_field_direct($this->$result, $i)->name,
mysqli_fetch_field_direct($this->$result, $i)->type,
//------------------------------------------------------------

//8:
print $this->tablewidths[$i].", /* ".mysql_field_name($this->results,$i)." */\n\t\t":
print $this->tablewidths[$i]." /* ".mysql_field_name($this->results,$i)." */\n\t\t";
print $this->tablewidths[$i].", /* ".mysqli_fetch_field_direct($this->$result, $i)->name." */\n\t\t":
print $this->tablewidths[$i]." /* ".mysqli_fetch_field_direct($this->$result, $i)->name." */\n\t\t";
//------------------------------------------------------------

//9:
$this->colTitles[$i] = mysql_field_name($this->results,$i) ;
switch (mysql_field_type($this->results,$i)){
$this->colTitles[$i] = mysqli_fetch_field_direct($this->$result, $i)->name ;
switch (mysqli_fetch_field_direct($this->$result, $i)->type){
//------------------------------------------------------------

//10:
mysql_data_seek($this->results,0);
mysqli_data_seek($this->results,0);