im missing a ; somewhere, but i dont see where. Im kinda just making this all up as I go anyway, pulling examples and tutorials where i can find them.
im trying to allow the user to search a DB for certain fields to match teh submitted info, and to display part of each record that matches.
heres the code:
<?php
include("dbconnection.php");
?>
<?php
if (isset($_POST['search'])) {
$search = $_POST['search'];
$date = $_POST['date'];
$query = "SELECT firstname,lastname,city,state,email FROM customers WHERE firstname OR lastname OR city OR state OR email = '$search' AND date >= '$date' ORDER BY date asc";
} else {
$result = odbc_exec($cnx, $query);
}
while ($row = odbc_exec($result)) {
echo "
<center>
<TABLE CELLPADDING=0 CELLSPACING=0 width="80%"><tr align=center bgcolor=lightsteelblue>
<th><font face="Tahoma" size="1"><b>First Name:</b></font></th>
<th><font face="Tahoma" size="1">Last Name:</font></th>
<th><font face="Tahoma" size="1">City:</font></th>
<th><font face="Tahoma" size="1">State:</font></th>
<th><font face="Tahoma" size="1">Email:</font></th>
</tr><br>
<tr align=center bgcolor=gainsboro>
<td><font face="Tahoma" size="1">$row[firstname]</font></td>
<td><font face="Tahoma" size="1">$row[lastname]</font></td>
<td><font face="Tahoma" size="1">$row[city]</font></td>
<td><font face="Tahoma" size="1">$row[state]</font></td>
<td><font face="Tahoma" size="1">$row[email]</font></td>
</tr>
</table>
</center> ";
}
?>
i know i prolly made a stupid mistake somewhere in here, but i cant find a good reference for PHP ODBC stuff anywhere. yes, I used google. I can find some stuff, but i need something that shows the ODBC equivalent to MYSQL functions.