PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
cakeFest
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Unknow error with MDB2

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database
View previous topic :: View next topic  
Author Message
faust



Joined: 17 Jul 2008
Posts: 7

PostPosted: Wed Jul 23, 2008 11:02 am    Post subject: Unknow error with MDB2 Reply with quote

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) "" }
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 911

PostPosted: Wed Jul 23, 2008 1:24 pm    Post subject: Reply with quote

$resultset->getDebugInfo() contains a more helpful message.
Back to top
View user's profile Send private message
faust



Joined: 17 Jul 2008
Posts: 7

PostPosted: Wed Jul 23, 2008 1:35 pm    Post subject: Reply with quote

Thanks a lot, i have found error
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software