I have to admit I am very much a newbie at MySQL in general (but I'm
working on it).

I have a fairly complex (for me) query that I am trying to complete
using php. I can't get it to work, and I'm sure it's just in the way I
am phrasing the MySQL part of this. The premise of this is a four
question form that acts as a search engine to draw the appropriate
information out of the db. If anyone could help I would really
appreciate it. Here's what I have.

<?php
$conn  = mysql_connect($server, $user, $pass);
$select = mysql_select_db(realty, $conn);
$sql = "SELECT Realtor, HouseAddress, Bathrooms, Bedrooms, YearBuilt,
        Garage, Location, Basement, Info FROM properties
        WHERE Bathrooms =='".$a."'", "Bedrooms =='".$b."'", "Garage
=='".$c."'",
        "Basement =='".$d."'";
$result = mysql_query($sql, $conn);
        while ($record = mysql_fetch_assoc($result)){
            while (list($fieldvalue) = each ($record))
            echo $fieldname.;
        }
        if (mysql_num_rows($result) ==0){
      echo "Sorry, no matching results.";
}
?>

Barry



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to