Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

.php linking to a Database

Options
  • 12-03-2012 11:26am
    #1
    Closed Accounts Posts: 2,663 ✭✭✭


    I trying to link a php.xhtml file to my data base in Localhost

    I am using xampp in which i have a Database of estate inside that database i have the following tables

    Client, branch, Staff, PropertyForSale,Owner,Viewing

    I have 1 row inside the Client Table. in which i am trying to run a query that will show up in the webpage that i have,

    its showing the page when i go http://localhost/Clients/data.php.xhtml

    but it is not showing the query result.

    am i better off going with Access & Front page?


Comments

  • Registered Users Posts: 1,042 ✭✭✭Groinshot


    Cork24 wrote: »
    I trying to link a php.xhtml file to my data base in Localhost

    I am using xampp in which i have a Database of estate inside that database i have the following tables

    Client, branch, Staff, PropertyForSale,Owner,Viewing

    I have 1 row inside the Client Table. in which i am trying to run a query that will show up in the webpage that i have,

    its showing the page when i go http://localhost/Clients/data.php.xhtml

    but it is not showing the query result.

    am i better off going with Access & Front page?

    to show the result of the query, you want to run the query, get the result, and print it somwhhere... Something like:
    <?php
    $con = mysql_connect("localhost","username","pw");
    mysql_select_db("estate", $con);
    $result = mysql_query("SELECT * FROM Client");
    
    while($row = mysql_fetch_array($result))
      {
      print_r($row);
      }
    
    mysql_close($con);
    ?>
    

    That will run the query, and print out your returned object, one for each row!


Advertisement