comparing form to database
Posted 10 July 2006 - 01:17 AM
1. create a form page in HTML
2. create a .php page that queries an ODBC database that I have, and compares info submitted
in the form to info in my database.
My question is how can i make the comparison between my form and my databse.
<form action="process.php" method="get">
<input name="mlsnumber" type="text" />
<input name="" type="submit" />
process.php--- "this is what i have so far...
# connect to a DSN "homep_props" with a user and password ""
$connect = odbc_connect("homep_props", "", "");
# query the users table for *
$query = "SELECT * FROM props";
# perform the query
$result = odbc_exec($connect, $query);
Posted 10 July 2006 - 01:41 AM
<?php $mlsnumber = trim(strip_tags($_GET['mlsnumber'])); // retrieve and remove whitespace, etc.
To help, we'll need a better understanding of what you want to compare ...
Posted 10 July 2006 - 02:46 AM
The 1st field of the records is the ID number, the next field is the mlsnumber.
I want to be able to compare the input from the form (form mlsnumber) to the field in my database. e.g. if they match output TRUE, if not output FALSE.
Posted 10 July 2006 - 03:25 AM
$fmlsnumber = $_GET['mlsnumber']; (form input mlsnumber)
# fetch the data from the database
$mlsnumber = odbc_result($result, 2); (database mlsnumber; the location of it in the database)
# print("$mlsnumber \n");
to somehow compare the two?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users