Jump to content

PDO Help


php-pendejo

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/285007-pdo-help/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/285007-pdo-help/#findComment-1463547
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.