George,

Whether you can select into an array directly depends on your database.

In any case, PHP executes database queries and returns a handle or 
container which is accessed as an array.
Here's the example from 
http://www.php.ca/manual/en/function.mysql-fetch-array.php

<?php
mysql_connect($host, $user, $password);
mysql_select_db("database");
$result = mysql_query("select user_id, fullname from table");
while ($row = mysql_fetch_array($result)) {
     echo "user_id: ".$row["user_id"]."<br>\n";
     echo "user_id: ".$row[0]."<br>\n";
     echo "fullname: ".$row["fullname"]."<br>\n";
     echo "fullname: ".$row[1]."<br>\n";
}
mysql_free_result($result);
?>

If you want a tutorial on this, Julie Meloni has some really good examples 
at http://www.thickbook.com and there are others at DevShed and WebMonkey.

Cheers - Miles




At 02:42 PM 1/16/2002 +0200, George Lioumis wrote:
>Hello everyone!
>
>I have the following table:
>
>|name
>|--------------
>|n_id
>|n_name
>|ns_id
>---------------
>
>I do a select: "SELECT n_name from name" and  I want to put all selected 
>"n_name" values into an array (say it names)
>
>How can this be done??
>
>Thanx in advance.


-- 
PHP Database 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]

Reply via email to