RE: [PHP-DB] array
| From: | Bastien Koert | Date: | Fri, 30 Mar 2007 00:00:00 +0000 |
| Subject: | RE: [PHP-DB] array | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-43373@lists.php.net to get a copy of this message | ||
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_________________________________________________________________ Check Out Our List Of Trendy Restaurants. You'll Eat It Up! http://local.live.com/?mkt=en-ca/?v=2&cid=A6D6BDB4586E357F!378......... ................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.