Mike Smith - 2023-10-02 19:31:46
I have found this class to be very useful getting an old application running on AWS.
But I did get a problem with mysql_num_fields(). I have pasted below my version which seems to work now:-
public static function mysql_num_fields($result){
// -- This doesn't work like in mysql. It returns the number
// -- of fields in the last query, not the number of fields
// -- in $result!
//$link = self::$currObj;
//return mysqli_field_count($link);
// -- This seems to work!
// return $result->field_count;
// -- Surely it should always been this?
return mysqli_num_fields($result);
}
I found it when the code I was getting to work was doing something like:-
$result1 = mysql_query(..,);
$result2 = mysql_query(...);
$fields = mysql_num_fields($result1);
In this case $fields contained the number of fields in $result2 not in $result1.