-
> From: Richard Lynch [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 12, 2006 12:49 PM
> To: Ahmed Abdel-Aliem
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] remove keys from array
>
> On Sun, June 11, 2006 6:57 am, Ahmed Abdel-Aliem wrote:
> > hi all
>
This looks to me as printet result array from database:
$query = mysql_query("select * from table");
$result = mysql_fetch_array($query);
if you
print_r($result);
you'll get "doubled" values.
use
$result = mysql_fetch_array($query, MYSQL_ASSOC);
for "singles"
check: http://us2.php.net/manual/en/f
Crap.. I remember seeing an example of something that yielded arrays like this
and now I can't find it.
It basically created an array (from a database I thought.. but can't find the
example under mysql_fetch_assoc or mysql_fetch_array... thought it was in the
standard PHP documentation (not the
On Sun, June 11, 2006 6:57 am, Ahmed Abdel-Aliem wrote:
> hi all
> when i have array in the form of :
> Array ( [0] => 2 [ID] => 2 [1] => asdasd [CategoryName] => asdasd ) )
> how can i make it in the form of :
> Array ( [ID] => 2 [CategoryName] => asdasd ) )
>
> can anyone help me with that plz ?
if you pull this array from mysql use this:
$query = mysql_query("SELECT * FROM table");
$result = mysql_fetch_array($query, MYSQL_ASSOC);
-afan
Rabin Vincent wrote:
On 6/11/06, Ahmed Abdel-Aliem <[EMAIL PROTECTED]> wrote:
when i have array in the form of :
Array ( [0] => 2 [ID] => 2 [1] => as
On 6/11/06, Ahmed Abdel-Aliem <[EMAIL PROTECTED]> wrote:
when i have array in the form of :
Array ( [0] => 2 [ID] => 2 [1] => asdasd [CategoryName] => asdasd ) )
how can i make it in the form of :
Array ( [ID] => 2 [CategoryName] => asdasd ) )
To remove a single element you can use unset: unset
hi all
when i have array in the form of :
Array ( [0] => 2 [ID] => 2 [1] => asdasd [CategoryName] => asdasd ) )
how can i make it in the form of :
Array ( [ID] => 2 [CategoryName] => asdasd ) )
can anyone help me with that plz ?
--
Ahmed Abdel-Aliem
Web Developer
www.SafariStudio.net
+2010110855
7 matches
Mail list logo