Hey. I have this query...
INSERT INTO umeta (user_id, umeta_key, umeta_value) VALUES ('14', 'first_name', 'Marlon');INSERT INTO umeta (user_id, umeta_key, umeta_value) VALUES ('14', 'last_name', 'Valenzuela');INSERT INTO umeta (user_id, umeta_key, umeta_value) VALUES ('14', 'city', 'Barrie');INSERT INTO umeta (user_id, umeta_key, umeta_value) VALUES ('14', 'province', 'Ontario');INSERT INTO umeta (user_id, umeta_key, umeta_value) VALUES ('14', 'email', 'so.phis.ti.kat@marlonvalenzuela.net');INSERT INTO umeta (user_id, umeta_key, umeta_value) VALUES ('14', 'join_date', NOW());INSERT INTO umeta (user_id, umeta_key, umeta_value) VALUES ('14', 'display_name', 'so.phis.ti.kat');
db.killConnection :: invalid query - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';INSERT INTO umeta (user_id, umeta_key, umeta_value) VALUES ('14', 'last_name', ' at line 1
... and it suppose to enter multiple records for this one user. if i run the query within phpMyAdmin, i get no errors. when I run it through php, she don't work. I have tried changing the delimeter to blank and comma and it doesn't work.
what am i missing here?
here's the code
private function add_umeta($user_id) {
/*
* Table Structure
* ============
* umeta_id
* user_id
* umeta_key
* umeta_value
*/
$insert_str = "INSERT INTO umeta (user_id, umeta_key, umeta_value)";
$query = $insert_str . " VALUES ('". $user_id . "', 'first_name', '".$this->profile['First_Name']."') ";
$query .= $insert_str . " VALUES ('". $user_id . "', 'last_name', '".$this->profile['Last_Name']."') ";
$query .= $insert_str . " VALUES ('". $user_id . "', 'city', '".$this->profile['City']."') ";
$query .= $insert_str . " VALUES ('". $user_id . "', 'province', '".$this->profile['Province']."') ";
$query .= $insert_str . " VALUES ('". $user_id . "', 'email', '".$this->user['e']."') ";
$query .= $insert_str . " VALUES ('". $user_id . "', 'join_date', NOW()) ";
$query .= $insert_str . " VALUES ('". $user_id . "', 'display_name', '".$this->profile['Username']."');";
echo "<br/>query = " . $query . "<br/>";
if ($this->db->runQuery($query)) {
return true;
}
echo "<br/>unable to add to umeta table: " . mysql_error();
return false;
}