1
$this->Settings = array( "host" => $host , "user" => $user , "pass" => $pass );
    $this->db = $db;
    $this->Settings["name"] = ereg_replace  ("_", "", $this->db);
    $this->init();

I have an application that can't work after migrating to php 5.3 from php 5.2.

Even after i changed the ereg_replace line above to

$this->aSettings["name"] = preg_replace("/_/", "", $this->db);

It still doesn't get the settings from the db.

1
  • If the problem is that the value is not retrieved from the database then the problem is in your $db variable. Try to inspect its value: var_dump($db) Commented Oct 11, 2012 at 8:02

1 Answer 1

3

There's no particular reason why your preg_replace() wouldn't work, but you could simply use str_replace() instead.

$this->Settings['Name'] = str_replace('_', '', $this->db);

This statement interests me though:

$this->db = $db;

Where is $db set? Follow that trail until you find where the real issue is,

Sign up to request clarification or add additional context in comments.

2 Comments

thanks. yeah.. that's not the issue. it is hard to trace as there are no errors even when error reporting is set to all.
@PotentialCoder You need to share more of your code then, otherwise it's impossible to help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.