Need help with creating a database!!

3 replies
I've created a site which almost to completion. I used text wrangler as my text editor and PHP MySQL sever on IOS. Ive created the forms for my login,registration, and others but i can't seem to get the Php pages connected or working. Am I missing anything (program or software) to make these pages work? I need help!!!
#creating #database
  • Profile picture of the author KirkMcD
    Originally Posted by Treveesgazi View Post

    Am I missing anything (program or software) to make these pages work?
    Probably, but without seeing your code and site setup, we'll never know what.
    {{ DiscussionBoard.errors[10395507].message }}
  • Profile picture of the author NexWebSites
    Test your connection with a simple script, replace the "<CAPITAL_VARIABLES>" below with your own actual variables, see the results.

    <?php
    $username = "your_name";
    $password = "your_password";
    $hostname = "localhost";

    //connection to the database
    $dbhandle = mysql_connect($hostname, $username, $password)
    or die("Unable to connect to MySQL");
    echo "Connected to MySQL<br>";

    //select a database to work with
    $selected = mysql_select_db("<YOUR_DATABASE_NAME>",$dbhandle)
    or die("Could not select <YOUR_DATABASE_NAME>");

    //execute the SQL query and return records
    $result = mysql_query("SELECT <ID>,<NAME> FROM <USERS>");

    //fetch tha data from the database
    while ($row = mysql_fetch_array($result)) {
    echo "ID:".$row{'<ID>'}." Name:".$row{'<NAME>'}; //display the results

    }
    //close the connection
    mysql_close($dbhandle);
    ?>
    {{ DiscussionBoard.errors[10396283].message }}
  • Profile picture of the author richasharma
    connection code must be clear
    <?php
    $servername = "localhost";
    $username = "username";
    $password = "password";

    // Create connection
    $conn = mysqli_connect($servername, $username, $password);
    ?>
    {{ DiscussionBoard.errors[10406340].message }}

Trending Topics