php-pendejo Posted December 31, 2013 Share Posted December 31, 2013 (edited) Wow I have to say its been a long time since I posted here but I do need alittle help so here we go: I got this script or created most of it (I dont remember) for me to connect mysql using PDO. The script works fine exept when i try to update a column in my db. now i get no errors but it does not update. $superglobals = array($_POST); foreach ($superglobals as $value){ foreach ($value as $k => $v){ $post[$k]=$v; } } $sql = "UPDATE ".DB_PREFIX."_dbase SET value = :value WHERE key = :key"; foreach ($post as $key => $value) { $bind = array("value"=> $value, "key"=>$key); $db->execute($sql, $bind) or die($db->error()); } I have upload the db class and gave you what im trying to do please help Here is the database CREATE TABLE db_dbase ( key text, value text ) database.php Edited December 31, 2013 by php-pendejo Quote Link to comment https://forums.phpfreaks.com/topic/285007-pdo-help/ Share on other sites More sharing options...
php-pendejo Posted January 1, 2014 Author Share Posted January 1, 2014 I guess no one knows what or how to help me. the script works on insert and connecting to the database and deleting and so on. the problem starts just when updating. my connection looks like this $DATABASE = array( "dsn" => "mysql:host=localhost;port=3306;dbname=database", "username" => "root", "password" => "password" ); so whoever wants to use this can do with it what they like enjoy Quote Link to comment https://forums.phpfreaks.com/topic/285007-pdo-help/#findComment-1463547 Share on other sites More sharing options...
mac_gyver Posted January 1, 2014 Share Posted January 1, 2014 what have you done to debug what your code and data are doing? is the form submitting data with the correct key/value that you expect? showing us what the form data is, would help someone to attempt to help. Quote Link to comment https://forums.phpfreaks.com/topic/285007-pdo-help/#findComment-1463549 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.