Data Base search
Posted: Wed May 11, 2011 1:41 am
i have php code,
<?php
include ("connect.php");
$selecteddate = $_POST['sdate'];
$sql1 = "select date from game1";
$query1 = mysql_query($sql1) or die(mysql_error());
while($row = mysql_fetch_assoc($query1))
{
$rowdate = $row['date'];
// problem here i this while loop only compare my latest last value in
database. i want a code here which search all the data in "date" field.
}
if($selecteddate == $rowdate)
{
echo "Date already Exists";
}
else
{
// form insertion data code here which i have and working fine
}
<?php
include ("connect.php");
$selecteddate = $_POST['sdate'];
$sql1 = "select date from game1";
$query1 = mysql_query($sql1) or die(mysql_error());
while($row = mysql_fetch_assoc($query1))
{
$rowdate = $row['date'];
// problem here i this while loop only compare my latest last value in
database. i want a code here which search all the data in "date" field.
}
if($selecteddate == $rowdate)
{
echo "Date already Exists";
}
else
{
// form insertion data code here which i have and working fine
}