Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2013
    Posts
    1

    Unanswered: Posting MySql value to web page.

    I am trying to display a price from a table I created in MySQL to a web page. I have created a php form to open and select the home. The data base is simple with a table called homes fields home - size and 4 price fields one being mobile which I am showing here. My problem is figuring out how to get the information to show up on my designs.html page. Below is the code I am using, I would appreciate any assistance.

    php for opening database and file. data2.php
    <?php
    require('mysqli_connect.php');
    $q = "SELECT * FROM homes WHERE home='solera'";
    $result = @mysqli_query ($dbcon, $q);
    $row = mysqli_fetch_array($result, MYSQLI_ASSOC;
    echo ' . $row['mobile'] . ';?>

    html on page to request it on designs.html
    <div class="homes">
    <div class="home"><img src="../images/homes/Solera.jpg" alt="Solera Home"/><br>
    The Solera $<?php src="data2.php"?></div>

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    HTML pages can't parse PHP.

    Change designs.html to designs.php and have a play then
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •