Jump to content

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

Edited by php-pendejo
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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.