php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #43891 mysql_fetch_field for PDO
Submitted: 2008-01-18 21:04 UTC Modified: 2017-04-24 19:10 UTC
Votes:7
Avg. Score:4.7 ± 0.7
Reproduced:4 of 5 (80.0%)
Same Version:3 (75.0%)
Same OS:4 (100.0%)
From: mynameismrburns at yahoo dot com Assigned: adambaratz (profile)
Status: Closed Package: PDO MySQL
PHP Version: 5.2.5 OS: any
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mynameismrburns at yahoo dot com
New email:
PHP Version: OS:

 

 [2008-01-18 21:04 UTC] mynameismrburns at yahoo dot com
Description:
------------
I Couldn't find anything that replace the mysql_fetch_field function in PDO.

I just found this hint: "pdo doesn't care about charsets. if you want to have your connection in unicode / utf-8 or any other encoding, you'll have to tell your database, for example using $dbh->exec('SET CHARACTER SET utf8') (mysql)"

But what is with Tables like this:

SET CHARACTER SET utf8;
CREATE TABLE `newtable` ( 
  `Id` int(11) NOT NULL auto_increment, 
  `NewField` varchar(255) default NULL, 
  `NewField2` varbinary(255) default NULL, 
  PRIMARY KEY  (`Id`) 
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; 

If I now SELECT something, Id and NewField is UTF8 but NewField2 is still binary (like a JPEG).

Is there an option or is this not implemented?



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-01 23:54 UTC] jani@php.net
-Package: Feature/Change Request +Package: PDO related
 [2017-04-24 19:10 UTC] adambaratz@php.net
-Status: Open +Status: Closed -Package: PDO related +Package: PDO MySQL -Assigned To: +Assigned To: adambaratz
 [2017-04-24 19:10 UTC] adambaratz@php.net
PDOStatement::getColumnMeta() should be used to retrieve this information. If you'd like additional information returned with that call, please open a new feature request ticket.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 02:01:28 2024 UTC