problems connecting to MySQL

zigs

New member
Joined
Dec 27, 2008
Messages
1
Hello. I'm trying to connect to my MySQL database. I'll admit that I'm new, but I can't see why this is not working. in fact, the PHP part returns nothing when i run it (im unsure about the details, like the hostname and such, but i still dont understand why it returns nothing):

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index</title>
</head>
<body>
    Hello test 1
    <br/>
    <?php
        $dbc = mysqli_connect("http://izfree.com/", "zigs_zigs", "123456123456") or die (mysqli_error() );

        $dbc = mysqli_select_db($dbc, "zigs_zigs") or die(mysqli_error());

        $r = @mysqli_query($dbc, "SELECT * FROM user_profiles");
        if($r){
            echo 'success!';
        }else{
            echo 'failure!';
        }
    ?>
    <br/>
    Hello test 2

</body>
</html>
 
PHP:
$dbc = mysqli_connect("http://izfree.com/", "zigs_zigs", "123456123456") or die (mysqli_error() );

should be:

PHP:
$dbc = mysqli_connect("localhost", "zigs_zigs", "123456123456") or die (mysqli_error() );

If that doesn't work, change mysqli_connect to mysql_connect.

And if you're wondering, yes I am the same hamster, the owner of izFree ;)
 
You should look in your server log for info on what went wrong. If there is nothing there, you need to call error_reporting() to select your level of detail and make sure log_errors is on - via ini_set() if not otherwise enabled.
 
zigs has not responded since his first post 2 weeks ago. I do not think he is interested in a solution anymore.
 
Back
Top