0

Whenever a mysql function is called, the script just dies. No output, and no "die" output either. No output about it on the php error logs either. I can't log into the db and access at all. Php just dies and I get a screen as if there was no page. How can I fix this? Or at the very least, get any output about the error to troubleshoot?

Same happens when using root. And, even when the info is wrong, there's no output. But, when going to the Drupal site, there's output at least when the log in info is wrong.

Here's the code of my main site's db class

class DB{
    public $con = null;
    public $user = 'viewer';
    public $pass = 'viewer';

    function __construct(){
        ini_set('display_errors', 1); 
        error_reporting(E_ALL);
        echo $this->user.' '.$this->pass.' wee';
        $con = mysql_connect("localhost",$this->user,$this->pass);// or die(mysql_error());
        //echo "connected";
        //mysql_select_db("db_name", $con);*/
    }

    function query($query){
        /*$query = mysql_real_escape_string($query);
        $return = mysql_query($query) or die(mysql_error());
        return $return;*/
    }
    function fetch_array($result){
        //return mysql_fetch_array($result);
    }

    function __destruct() {
        if (isset($con) ){
            mysql_close($con);
        }
    }
}
?>

Thanks

4
  • Take a look at mysqli... us3.php.net/mysqli
    – MetalFrog
    Commented Jan 11, 2012 at 20:15
  • If you leave the die() in there, does it generate an error?
    – Jack M.
    Commented Jan 11, 2012 at 20:43
  • @Jack M: Nope, die doesn't make a difference. Sorry for the bad example though, leaving it commented. I had it uncommented and before posting this question, I tried commenting.
    – efaj
    Commented Jan 12, 2012 at 3:47
  • @MetalFrog: I thought mysqli was another type of db, but now I'm enabling to see what happens.
    – efaj
    Commented Jan 12, 2012 at 3:47

1 Answer 1

0

Alright! Found what it is: On MetalFrog's recomendation, I started enabling mysqli (and learned about it and plan to look into it more), when I ran apache, it gave this error output:

The procedure entry point mysql_slave_query could not be located dynamic link library libmysql.dll

That was the error. When using just the mysql extension, it didn't check for that, and as such, the error was quite subtle. In my case, the extra libmysql.dll was on apache/bin. It would be more often that it's on windows/system32. Only the /php one should be in the path.

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.