Ticket #428 (new defect)
Opened 22 months ago
Fix for client import
| Reported by: | rolandd | Owned by: | brieb |
|---|---|---|---|
| Priority: | minor | Milestone: | unknown |
| Component: | phpbms | Version: | 0.96 |
| Keywords: | Cc: |
Description
From: http://www.phpbms.org/forum/viewtopic.php?f=30&t=715&p=2123#p2123
Today I ran into an issue wanting to import a CSV with client data. Opening this page I received a Page cannot be displayed. After a little investigation I found the issue to be in the db.php file. Line numbers may vary a bit as I did a lot of debugging.
The issue is the use of function mysql_list_fields, which is deprecated. This is used in the function tableInfo on line 459. I replaced the switch with this:
switch($this->type){
case "mysql":
//$queryresult = @mysql_list_fields($this->schema,$tablename); $queryresult = mysql_query("SELECT * FROM ".$tablename); $fields = mysql_num_fields($queryresult); if($queryresult){
for($offset = 0; $offset < $fields; ++$offset){
$name = $this->fieldName($queryresult,$offset);
$thereturn[$name]type? = mysql_field_type($queryresult,$offset); $thereturn[$name]length? = mysql_field_len($queryresult,$offset); $thereturn[$name]flags? = mysql_field_flags($queryresult,$offset);
}//endfor
}//endif
break;
}//end case