Re: splitting arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$sql="select * from users";
$result="mysql_query($sql) or die (mysql_error());
while($array=mysql_fetch_array($result))
{
	array1[]=$array['name'];
	array2[]=$array['picture'];

}




Reinhart Viane wrote:

hey all,

I have a question concerning arrays.
Folowing situation:

usertable

$sql="select * from users";
$result="mysql_query($sql) or die (mysql_error());
$array=mysql_fetch_array($result);

Now this give me an array, i can get specific information with
array['username']

What i need to do now is to split up this information so i have new
arrays, or results which i can use in javascript.
Say array1 loops all usernames and puts them in a new array while
another array2 is builed up with all pictures url's of every user.

array1[0]=John
array1[1]=Mike
array1[3]=Pete

and the other array is
array2[0]=picture of John
array2[1]=picture of Mike
array2[3]=picture of Pete

Target is to populate a combobox with the usernames and to show there
pictures when the names are clicked (with javascript / no page refresh).

Can someone help me on this?

Thx in advance
Reinhart

_____

Reinhart Viane <mailto:rv@xxxxxxxx> rv@xxxxxxxx Domos || D-Studio Graaf Van Egmontstraat 15/3 -- B 2800 Mechelen -- tel +32 15 44 89 01 --
fax +32 15 43 25 26



STRICTLY PERSONAL AND CONFIDENTIAL This message may contain confidential and proprietary material for the
sole use of the intended recipient. Any review or distribution by others is strictly prohibited.
If you are not the intended recipient please contact the sender and delete all copies.







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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux