hello. I am getting a blank page on localhost/myproject/
i am pretcty sure th.at\ it cant connect to the database because when i am using a simple echo it returns. for example
<?php echo 'DDD'; ?>

THE THING IS THAT I AM USING WOS PORTABLE IS IT POSSIBLE THAT IT DOESNT SUPPORT PHPMYADMIN?

I HAVE IMPORTED THE DATABASE ON localhost/phpmyadmin/

Re: can't connect to database 80 80

Okay, questionaire:

  1. Do you have Apache server? Start it.
  2. Do you have MySQL server? Start it.
  3. Create a file called config.php, put inside

    <?php
        $sql_un = "root";   // default: "root";
        $sql_pd = "";       // default: "";
        $sql_db = "";       // you will need to create database and input here it's name
        $sql_conn = mysqli_connect("127.0.0.1", $sql_un, $sql_pd, $sql_db);
        if (!$sql_conn) {
            die("Something didn't work, the file couldn't connect to database!");
        }
        echo "File's request has been successfully sent and answer received.";
    ?>
    

I don't get the <?php echo 'DDD'; ?> part... what about it?

Re: can't connect to database 80 80

i just did so i see what it returns without connecting to db. Where shall i put the config file?

Re: can't connect to database 80 80

nothing still a blank page

Re: can't connect to database 80 80

ok. when i use this $sql_conn = mysql_connect("127.0.0.1", $sql_un, $sql_pd, $sql_db); it replies File's request has been successfully sent and answer received.

when i leave it as you send it to me
$sql_conn = mysqli_connect("127.0.0.1", $sql_un, $sql_pd, $sql_db);
it returns a blank page

Re: can't connect to database 80 80

mysql is how the database is called, but there has been an update to it called mysqli which is essentially just "MySQL improved", I think you need to upgrade your SQL server. The file should be put inside of htdocs or www folder, but you already figured that out.

Re: can't connect to database 80 80

mysqli extension not enabled in the php.ini?

Re: can't connect to database 80 80

yes thats the issue i was using wos portable and it doesnt supports php 5.4, only php 4 thats why ive been having problems. For future reference i had problems. as

  1. Couldn't read private or public funcion (i mean the syntax of cit ) i change them to function and it worked. I dont know how to put it better. Sorry
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.