faust
Joined: 17 Jul 2008 Posts: 7
|
Posted: Wed Jul 23, 2008 11:02 am Post subject: Unknow error with MDB2 |
|
|
I want create a simple function, which updates date i table. Unfortunately I am getting "Unknow error". Plese help me find error.
Here is code:
| Code: |
$sql = "UPDATE gomze_users SET name = Paweł, sex = facet, email = , about_me = ?, age = ?, state = ?, city = ?, gg = ?, strong_tags = ?, tags = ? where username = ?";
$types = array('text', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'text', 'text', 'text');
$statement = $this->_con->prepare($sql, $types, MDB2_PREPARE_MANIP);
$data = array($update['name'], $update['sex'], $update['email'], $update['about_me'], $update['date'], $update['state'], $update['city'], $update['gg'], $update['strong_tags'], $update['tags'], $update['username']);
$resultset = $statement->execute($data);
if(PEAR::isError($resultset)) {
throw new Exception('2.'.$resultset->getMessage());
}
$statement->Free(); |
And here is var_dump($update)
| Code: |
array(14) { ["username"]=> string(7) "juhas34" ["email"]=> string(19) "faust1002@gmail.com" ["city"]=> string(13) "Kamienna Góra" ["day"]=> string(1) "1" ["month"]=> string(2) "01" ["year"]=> string(4) "2001" ["date"]=> string(9) "2001-01-1" ["name"]=> string(5) "Pawel" ["state"]=> string(12) "dolnoslaskie" ["sex"]=> string(5) "Facet" ["about_me"]=> string(0) "" ["gg"]=> string(0) "" ["strong_tags"]=> string(0) "" ["tags"]=> string(0) "" }
|
|
|