ID:               25460
 User updated by:  beckman at purplecow dot com
 Reported By:      beckman at purplecow dot com
 Status:           Closed
 Bug Type:         MySQL related
 Operating System: FreeBSD 5.0-RELEASE #0
 PHP Version:      4.3.3
 Assigned To:      georg
 New Comment:

So are mysql_field_* depreciated as well?  Should they be marked as
such in the documentation?  

You might want to put a nice replacement function in the documentation
for mysql_list_fields (and other depreciated functions) to allow people
to migrate away from mysql_list_fields smoothly and easily without
doing trial and error.  I haven't yet figured out how to do this while
continuing using mysql_field_* functions.  mysql_query("SHOW FIELDS
FROM db.table") doesn't return the same data in the same format as
mysql_list_fields does.


Previous Comments:
------------------------------------------------------------------------

[2003-09-10 13:03:01] beckman at purplecow dot com

Whoops.  Now that you've marked it depreciated, I withdrawal my bug
report!  I'll get phpMyAdmin to stop using it, and thus this bug goes
away.  But just for me feeling good, can you not mark it bogus?  That
makes me feel like less of a man, and much less of a geek... :-)  A
closed would be so much better.

------------------------------------------------------------------------

[2003-09-10 13:00:46] beckman at purplecow dot com

If your supposition is correct (phpMyAdmin is broken), then why would
mysql_list_fields("crt", "assignments") with a currently valid open
link to the database attempt to use the table mysql.assignments?  Even
if you give it a link, it uses the mysql database to find the table.

While I'm not a C/C++ programmer, I read the code for that function.  I
noticed that ZEND_FETCH_RESOURCE2 was added in 4.0 beta 3, and wonder
if THAT function is somehow causing this obscure occurence of this bug.
 

Why do I think it is a bug?  Because mysql_list_fields DOES work as
advertised in the code I could come up with.  HOWEVER, in that specific
example in phpMyAdmin, it does not.  I'm wondering if somehow
ZEND_FETCH_RESOURCE2 is returning the wrong mysql->conn that is being
used to connect to the DB and list the fields from a table.  

If any connection to a database can be used to read any DB from that
connection, and just before running mysql_list_fields I can do a "show
fields from crt.assignments" and it works using both a defined
link_resource or leaving it blank (using the currently selected
connection), why would mysql_list_fields("crt", "assignments") fail on
the next line?

I swear it isn't bogus.  And if it is, I'll buy you a beer or something
and hang my head in shame.

------------------------------------------------------------------------

[2003-09-10 03:50:39] [EMAIL PROTECTED]

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.



------------------------------------------------------------------------

[2003-09-10 03:43:58] [EMAIL PROTECTED]

assigned to myself 

------------------------------------------------------------------------

[2003-09-10 03:43:08] [EMAIL PROTECTED]

mysql_list_fields is deprecated, use SHOW COLUMNS FROM table 
[LIKE 'foo'] instead. 
 
This should be documented in the manual. Reclassified as 
documentation bug. 

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/25460

-- 
Edit this bug report at http://bugs.php.net/?id=25460&edit=1

Reply via email to