note 8449 modified in mysql_num_fields by ronabop

From: Date: Wed, 13 Sep 2000 15:55:28 +0000
Subject: note 8449 modified in mysql_num_fields by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-4815@lists.php.net to get a copy of this message
Examples? How about this for a highly contrived but hopefully understandable example: ------------------------ <?php function DoAQuery($Query) { $Result=mysql_db_query($Query); $NumberOfFields=mysql_num_fields($Result); print("There are $NumberOfFields Columns in the result<br>"); } $ConnectionResource=mysql_connect("localhost","User","Password"); $Query="SELECT This, That, TheOther from Some_Table ORDER BY This"; DoAQuery($Query); ?> ------------------------- Presuming I did that right, the entire output of this snippet should be "There are 3 Columns in the result" (assuming you actually have a mysql database with those fields, etc.) Presumably, in the Real World, you'd be using mysql_num_fields for formatting and such. Hey, I SAID it was highly contrived, didn't I? http://www.php.net/manual/function.mysql-num-fields.php

« previous php.notes (#4815) next »