Help with search
Posted: Wed Aug 20, 2008 11:27 am
Hey everyone,
This is my second script with PHP, but I'm getting better. Slowly. I have the following code:
I have a table in a database that has a column named vertification. It has a unique code that differs from every user. For starters, I want to see if the code they imput matches the one in the table. To go about this, I tried to perform a simple search using
$data = mysql_query("SELECT `vertification` FROM users WHERE '$find'") or die(mysql_error());
But the script doesn't echo anything. Sorry if I'm being unclear, but any help is appreciated. Thanks.
This is my second script with PHP, but I'm getting better. Slowly. I have the following code:
Code: Select all
<body>
<?
include_once "connect_users.php";
if($_POST['submit'])
{
if($_POST['submit'] != NULL)
{
$find=$_POST['vertification'];
$data = mysql_query("SELECT `vertification` FROM users WHERE '$find'") or die(mysql_error());
while($result = mysql_fetch_array( $data ))
{
echo "Code is: ".$result[$to_find];
}
}
}
else
{
echo '<p>Please enter your vertification code in the box below.</p>
<form name="form1" method="post" action="">
<label>
<input name="vertification" type="text" id="vertification">
</label>
<label>
<input type="submit" name="submit" id="submit" value="Submit">
</label>
</form>
<p> </p>';
}
?>
</body>
$data = mysql_query("SELECT `vertification` FROM users WHERE '$find'") or die(mysql_error());
But the script doesn't echo anything. Sorry if I'm being unclear, but any help is appreciated. Thanks.