[PHP] Extract all fields of a table to vars of same name

2001-12-04 Thread Baloo :0\)

Someone came with a very clever solution to simplify the extraction of all
fields when doing aselect * from table

it's a command that passes all values from the fields on the table to variables
of the same name than the field on that table.  No need to program it manually,
creates all variables with same names as the table fields.

Could someone tell me how to do this?

Alfredo


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Extract all fields of a table to vars of same name

2001-12-04 Thread Hank Marquardt

that would be extract() -- http://www.php.net/extract

On Tue, Dec 04, 2001 at 01:09:27PM -0700, Baloo :0) wrote:
 Someone came with a very clever solution to simplify the extraction of all
 fields when doing aselect * from table
 
 it's a command that passes all values from the fields on the table to variables
 of the same name than the field on that table.  No need to program it manually,
 creates all variables with same names as the table fields.
 
 Could someone tell me how to do this?
 
 Alfredo
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
Hank Marquardt [EMAIL PROTECTED]
http://web.yerpso.net
GPG Id: 2BB5E60C
Fingerprint: D807 61BC FD18 370A AC1D  3EDF 2BF9 8A2D 2BB5 E60C
*** Web Development: PHP, MySQL/PgSQL - Network Admin: Debian/FreeBSD
*** PHP Instructor - Intnl. Webmasters Assn./HTML Writers Guild 
*** Beginning PHP -- Starts January 7, 2002 
*** See http://www.hwg.org/services/classes

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Extract all fields of a table to vars of same name

2001-12-04 Thread Jim


I do this ...

$query = mysql_query(SELECT * FROM foo);
$data = mysql_fetch_assoc($query);
extract($data);

if you need all the rows from the query, do ...

$query = mysql_query(SELECT * FROM foo);
while($data = mysql_fetch_assoc($query) {

extract($data);

}


Jim

Someone came with a very clever solution to simplify the extraction of all
fields when doing aselect * from table

it's a command that passes all values from the fields on the table 
to variables
of the same name than the field on that table.  No need to program 
it manually,
creates all variables with same names as the table fields.

Could someone tell me how to do this?

Alfredo


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Extract all fields of a table to vars of same name

2001-12-04 Thread Baloo :0\)

Someone came with a very clever solution to simplify the extraction of
all
fields when doing aselect * from table

it's a command that passes all values from the fields on the table to
variables
of the same name than the field on that table.  No need to program it
manually,
creates all variables with same names as the table fields.

Could someone tell me how to do this?

Alfredo


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]