php - insert and select strings array from database.? -


I want to put all the string array databases in one line, and after that, somewhere else only the first part They (wire array) and they (first part string array) are displayed by loop forward.

I use [ serialized or implode or json_encode or ? ]? Can you give me an example?

Example:
Data (string array):

  1. "input name = 'units []'" = value = & Gt; Hello, how, ou
  2. "input name = 'units []'" = value => Hello, What, Other

    I want this output:

    • Hello
    • Hello while and mysql_fetch functions:
        $ units = $ _REQUEST ['units' ]; $ Units = array_map ('mysql_real_escape_string', $ units); Mysql_query ("INSERT IN & lt; Table Name & gt; VALUES ('.' Implode (''), ('", $ units). "')");   

      then:

        $ q = mysql_query ('select & lt; by table name & gt;'); While ($ line = mysql_fetch_row ($ q)) {echo $ line [0]; Sometimes, however,  serialize  is a better option:  
        $ units = $ _REQUEST ['units'] ; $ Units = array_map ('mysql_real_escape_string', $ units); Mysql_query ("INSERT & lt; Table Name & gt; VALUES ('.' Serialize ($ units)." ') ");   

      then:

        $ q = mysql_query (choose 'From & lt; Table Name & gt;'); While ($ line = mysql_fetch_row ($ q)) {$ units = unserialize ($ line [0]); } Var_dump ($ units); // Use foreach here    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -