[prev in list] [next in list] [prev in thread] [next in thread]
List: php-db
Subject: RE: [PHP-DB] array
From: "Bastien Koert" <bastien_k () hotmail ! com>
Date: 2007-03-29 23:59:59
Message-ID: BAY135-F378000F44335F06917F5FA9D630 () phx ! gbl
[Download RAW message or body]
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 <elkdolk@yahoo.com>
>To: "php-db@lists.php.net" <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!378
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic