I need to insert mutiple data in the field and then to retrieve it as an array.
For example I need to insert “99999” into table item_details , field item_number, and the following data into field bidders associated with item_number :
userx
usery
userz
Can you please let me know what sql query should I use to insert the info and what query to retrieve it ?
I know that this may be a silly question but I just can’t figure it out .
thank you in advance,
Michael .
If you are simply wanting to store an array in a MySQL Field for later retrieval, then you could use
implode()[PHP Docs] as suggested above (which will destroy the array’s keys, but retain the array’s values), orserialize()[PHP Docs] which will retain both the values and the associated keys.If you are talking about using two related table to store data, then you are probably best advised to refer to tutorials like http://www.sql-tutorial.net/SQL-JOIN.asp, http://www.databasejournal.com/features/oracle/article.php/3527921/Just-SQL-Part-IV–Joining-Tables.htm