How to insert multiple rows and columns in database using array

That is not an accepted SQL syntax per the MySQL manual. You must

INSERT INTO MyGuests
        (firstname, lastname,   email)
VALUES  ('John',    'Doe',      '[email protected]')

But, and this is an expansion well beyond the scope of your question, if you have an array of this information, you could iterate over the whole thing to build your SQL string.

// The array of information
$guests = array(
    array(
        'first_name'    => 'John',
        'last_name'     => 'Doe',
        'email'         => '[email protected]',
    ),
    array(
        'first_name'    => 'Jane',
        'last_name'     => 'Doe',
        'email'         => '[email protected]',
    ),
);
// Build the SQL string
$sql="";
foreach($guests as $g) {
    if($sql != '') $sql.= ',';
    $sql .= '("'. $g['first_name'] .'", "'. $g['last_name'] .'", "'. $g['email'] .'")';
}
if($sql != '') {
    $sql = "INSERT INTO MyGuests (firstname, lastname, email) VALUES ". $sql;
}
// $sql now is either empty or full of lots of records to insert.