Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

.php linking to a Database

  • 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, Registered Users 2 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