Jump to content
Larry Ullman's Book Forums

arizonakid

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by arizonakid

  1. I have read the forum guidelines and have several of Larry Ullmans books. The one I am currently using is the second edition of 'PHP andMYSQL For Dynamic Web'

     

    I couldn't find the answer in this book so entered my question in this Forum. If I am wrong I can only apologise.

     

    one of my programs is for a Single Fuchsia and the code is as follows:

     

     

    <body background color=#c6c6c6>

    <form align="center"> <input name="cname" type="text" /> </form>

     

    <?php $dbh=mysql_connect ("localhost", "afs_tony", "suncity") or die ('I cannot connect to the database because: ' . mysql_error());

    mysql_select_db ("afs_afs");

     

    $id=$cname;

     

    $query = "SELECT * FROM `reglist` where Cultivar = '$id'";

     

    $result = mysql_query($query);

     

    set_time_limit(0);

     

     

    echo "<table border ='2'>";

    echo "<table align = 'center'>";

    echo " ";

    echo " ";

    echo " ";

     

     

    echo "<tr><td>";

    echo "<u><strong>Cultivar</strong></u>";

    echo "</td><td>";

    echo "<u><strong>Hybridizer</strong></u>";

    echo "</td><td>";

    echo "<u><strong>Year</strong></u>";

    echo "</td><td>";

    echo "<u><strong>Form</strong></u>";

    echo "</td><td>";

    echo "<u><strong>Growth</strong></u>";

    echo "</td><td>";

    echo "<u><strong>Corolla Color</strong></u>";

    echo "</td><td>";

    echo "<u><strong>Sepal Color</strong></u>";

    echo "</td><td>";

    echo "<u><strong>Tube Color</strong></u>";

    echo "</td><td>";

    echo "<u><strong>Parentage</strong></u>";

    echo "</td><td>";

    while ($row = mysql_fetch_array($result))

    {

     

    echo "</tr><td>";

    echo $row['Cultivar'];

    echo "</td><td>";

    echo $row['Hybridizer'];

    echo "</td><td>";

    echo $row['Year'];

    echo "</td><td>";

    echo $row['Form'];

    echo "</td><td>";

    echo $row['Growth'];

    echo "</td><td>";

    echo $row['Corolla Color'];

    echo "</td><td>";

    echo $row['Sepal Color'];

    echo "</td><td>";

    echo $row['Tube Color'];

    echo "</td><td>";

    echo $row['Parentage'];

    echo "</td><td>";

    echo "<tr><td>";

    echo "Click on Fuchsia Name to view image if available ";

    ?>

    <br>

    <?php

    echo $row['Image'];

     

     

     

     

    }

     

     

     

     

    ?>

    <br />

     

    <br />

     

    </body></html>

     

    Apologies for any confusion

     

    kind regards

     

    Tony Prodger

  2. I have recently created a menu using php that gives several options for searching a database using mysql:-

     

    1. display all records

    2. display a particular record

    3. display records beginning with a letter

     

    this works correctly but if I select another option the first results still appear on my display and i cannot remember how to clear the display between searches.

     

    Any advice please

     

    kind regards

     

    Tony

×
×
  • Create New...