array

array

am 29.03.2007 22:29:45 von elk dolk

--0-502843191-1175200185=:68344
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi all,
I want to put result of query in a two dimensional array like this:

title[0]=x description [0]=y
title[1]=z description [1]=w
.......... ................

any idea would be appreciated

$query = "SELECT * FROM photo";
$result=mysql_query($query);


while ($row = mysql_fetch_array($result))
{

$title=$row['title'];
$description=$row['description'];

}

---------------------------------
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
--0-502843191-1175200185=:68344--

RE: array

am 30.03.2007 02:00:00 von Bastien Koert

That is not a two dimensional array. Its two one dimensional arrays and yo
do it like this

while ($row = mysql_fetch_array($result))
{

$title[] =$row['title'];
$description[] =$row['description'];

}



bastien

>From: elk dolk
>To: "php-db@lists.php.net"
>Subject: [PHP-DB] array
>Date: Thu, 29 Mar 2007 13:29:45 -0700 (PDT)
>
>Hi all,
>I want to put result of query in a two dimensional array like this:
>
>title[0]=x description [0]=y
>title[1]=z description [1]=w
>......... ................
>
>any idea would be appreciated
>
>$query = "SELECT * FROM photo";
>$result=mysql_query($query);
>
>
>while ($row = mysql_fetch_array($result))
>{
>
> $title=$row['title'];
> $description=$row['description'];
>
> }
>
>---------------------------------
>Don't pick lemons.
>See all the new 2007 cars at Yahoo! Autos.

____________________________________________________________ _____
Check Out Our List Of Trendy Restaurants. You'll Eat It Up!
http://local.live.com/?mkt=en-ca/?v=2&cid=A6D6BDB4586E357F!3 78

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php