How show Multidimensional Arrays be inserted into a MySQL table?

后端 未结 2 1559
悲哀的现实
悲哀的现实 2021-01-21 05:55

In this table, I have the fields \'title\' \'url\' \'keywords\' and description that I want data entered into. By the way, all the fields i have are \'id\', \'title\', \'descrip

相关标签:
2条回答
  • 2021-01-21 06:33

    You should serialize and send it to db
    http://php.net/manual/en/function.serialize.php

    0 讨论(0)
  • 2021-01-21 06:36

    That depends, because you would have to do a table in the database with time,date,competition,first_team,second_team columns

    It really depends on how much you know at the moment, if you just want to log a plain array you can just serialize it into the database and unserialize it in the code

    e.g. php Code:

    $array = array ('one','two','three'); 
    $array = serialize ($array);
    var_dump ($array);
    $unseralize = unserialize ($array);
    var_dump ($unserialize);
    

    Something tells me you might want to just put it over the database and query the server then do the loop.

    0 讨论(0)
提交回复
热议问题