¿ can i store ARRAY on mysql database?

newbieee here… wondering if he can store ARRAY(s) on mysql database? …and if possible, how can i retieve it using php…:hangover:

you can use loops :)… i’ve done that before… i’ll post the script in a sec

woooh! that sounds good! hehhe :slight_smile:

myarray = ['ahmed', 'noxious', 'kirupa', 'someone'];
$ii=count($myarray);
mysql_connect('localhost', 'root', 'sesame');
mysql_select_db('dbname');
for($i=0; $i<$ii; $i++){ 
    $entry = $myarray[$i];
    $query = "INSERT INTO table_name ( column_name ) VALUES ('$entry');";
    mysql_query($query);
}

and to retrieve the data, make a select query (like the one in my sig :stuck_out_tongue: )

yo da man!!! super! lol
thanx man… now i’ll try work my way out in loading those arrays on flash… wish me luck! :slight_smile:

yeah your sig shows what you are… an sql addict? hehehee ;)!

hehe… let me know if you needed some more help =)

PHP:--------------------------------------------------------------------------------
$myarray = [‘ahmed’, ‘noxious’, ‘kirupa’, ‘someone’];
mysql_connect(‘localhost’, ‘root’, ‘sesame’);
mysql_select_db(‘dbname’);
$query = “INSERT INTO table_name ( column_name ) VALUES (’$myarray’);”;
mysql_query($query);


ahmed, is this possible?

havent tried it, but i really dont think so…
you can still try it anyways, and let me know =)