Jump to content

Renlok

Members
  • Posts

    258
  • Joined

  • Last visited

About Renlok

  • Birthday 03/18/1990

Contact Methods

  • Website URL
    http://www.we-link.co.uk

Profile Information

  • Gender
    Male
  • Location
    newbury

Renlok's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. For my search function im trying to build a search array but this part is giving my loads of problems I cant get it to work foreach ($payment as $key => &$val){if (!$pri){$ora = "((au.payment LIKE :payment{$val})";$asparams[] = array(":payment{$val}", '%' . $system->cleanvars($val) . '%', PDO::PARAM_STR);}else{$ora .= " OR (au.payment LIKE :payment{$val}) AND ";$asparams[] = array(":payment{$val}", '%' . $system->cleanvars($val) . '%', PDO::PARAM_STR);}$pri = true; } the $ora is just added to the SQL later and the $asparams is the parameter array that is passsed into bindParam later im getting the messasge anyone have any ideas?
  2. I fixed it changed it to $this->pdo = new PDO("mysql:host=$DbHost;dbname=$DbDatabase;charset=$CHARSET", $DbUser, $DbPassword);
  3. I am creating a PDO database handler class, I've never used it before and its very slow going so far it mostly works but i have a problem public function connect($DbHost, $DbUser, $DbPassword, $DbDatabase, $DBPrefix, $CHARSET) { $this->DBPrefix = $DBPrefix; $this->CHARSET = $CHARSET; try { // MySQL with PDO_MYSQL echo "SET NAMES $CHARSET"; $this->pdo = new PDO("mysql:host=$DbHost;dbname=$DbDatabase", $DbUser, $DbPassword, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES $CHARSET")); // set error reporting up $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // actually use prepared statements $this->pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); } catch(PDOException $e) { $this->error_handler($e->getMessage()); } } doesn't work unless i remove , array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES $CHARSET") and I have no idea why it isn't throwing any errors its just not working
×
×
  • 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.