how to Insert multi dimensional array in mysql? [duplicate]


Problem :

Possible Duplicate:
PHP - reformat multidimensional array to insert into MYSQL?

what I want to do is insert multi dimensional array in my database

here is my code,but it not working,

include 'config/config.php';
    $Currentdatetime = date("Y-m-d h:i:s" ,strtotime("now"));
    $senderID = '530738657,100003201126721,659276806,etc';
    $explode = implode(', ', array_shift($senderID));
    $result = array();
    foreach ($senderID as $row) {
        $result[] = "(" . implode(', ', $row) . ")";
    }
    $query = "INSERT INTO user_invite ($explode) VALUES('$userid','implode (', ', $result)','0','50','$Currentdatetime','0')");

any solution? thanks



Solution :

array_shift on senderID is an error senderID is a string!!!!

foreach on senderID is an error !!!!!

replace this

 $senderID = '530738657,100003201126721,659276806,etc';

with

     $senderID = explode(',', $senderID   );
    $senderID = '530738657,100003201126721,659276806,etc';

Mysql Tutorials

Mysql Howto..

How to set up mysql multi-triggers

How to use SQL in the most efficient way with very big tables

How to exclude duplicate addresses for reporting in MySQL?

How do I set the first entry of a combo box to empty? PHP/MySQL

show best matches in a mysql tag system

How to change rows in a table based on other table rows in mysql?

How to have an AND condition in HAVING clause in mysql?

How to properly GROUP BY in MySQL?

MySQL Query: How to select rows that don't have a certain value?

How to parse a word/phrase with 2 words with dictionary database (in PHP)

How insert multiple rows in mysql table with php array?

when this error come how to solve this error

How to read or write data from a MySQL cPannel Database in Java for an Android App

How can I access a PDO connection from a different file?

MySQL - How to query items by tags, order by matched tag count

Incremental backup with rollforward logs: How to get the logs with MySQL commands?

MYSQL how to add more rows if results are less than a number

How to store simple piece of data online without using MySQL?

How to convert list of nested dictionaries into string and vice versa

how to join tables without repeating column in mysql

How to sync mysql db between 2 localhost?

How do i deal with this situation for searching records in mysql?

MySQL: How to count from columns separately?

How could I log user-specific information (IP address etc) into a table? [duplicate]

How to reuse a prepared statement parameter in mysql

How to integrate AJAX to avoid page redirection of PHP CMS

How to monitor MySQL queries

How to check in mysql that normalized table is ok or not in mysql

How to retrieve a count number of specified values in mysql (even if no records)?

How to associate Article with multiple categories