From: pwhelan at exis dot cl
Operating system:
PHP version: 5.2.8
PHP Bug Type: Feature/Change Request
Bug description: missing sqlite_field_type function
Description:
------------
The function sqlite_field_type does not exist. The function
sqlite_fetch_column_types is a poor substitute when working with queries
with JOINs, since it would require a full blown SQL Parser.
This function is trivial to implement taking advantage of the behaviour of
sqlite_fetch, which passes the types of the columns in the same way it
passes the column names.
Reproduce code:
---------------
SQL:
CREATE TABLE foo (
id INTEGER PRIMARY KEY,
foo TEXT,
bar VARCHAR
);
<?php
$db = sqlite_open("database.db");
$res = sqlite_query("SELECT * FROM table LIMIT 1");
for ($i=0; $i < sqlite_num_fields($res); $i++) {
print "FIELD ".sqlite_field_name($res, $i).
"has type ".sqlite_field_type($res, $i);
}
?>
Expected result:
----------------
FIELD id has type INTEGER
FIELD foo has type TEXT
FIELD bar has type VARCHAR
Actual result:
--------------
Fatal error: Call to undefined function sqlite_field_types() in
/var/www/sys/db/fields.php on line 8
--
Edit bug report at http://bugs.php.net/?id=46807&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46807&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46807&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46807&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=46807&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=46807&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=46807&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=46807&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=46807&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=46807&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=46807&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=46807&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=46807&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=46807&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=46807&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46807&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46807&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=46807&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=46807&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=46807&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=46807&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=46807&r=mysqlcfg