This is very peculiar -- for some reason, I'm getting 6-8 results from each
of these queries, although only one listing matches. I have a pair of forms
on one page:
<FORM>
Search for lastname: ____________ [Submit]
</FORM>
<FORM>
Search for email: _______________ _ [Submit]
</FORM>
This goes to a searchresults.p hp page:
if ($searchname !== "") {
$query="SELECT artistID,firstn ame,lastname,em ail,city,state, country
from artists WHERE lastname='$sear chname'";
$result=mysql_q uery($query) or die(mysql_error ("Could not execute
query."));
while($row = mysql_fetch_arr ay($result)) {
$alt_artistID = $row['artistID'];
$alt_firstname = $row['firstname'];
$alt_lastname= $row['lastname'];
$alt_email = $row['email'];
$alt_city = $row['city'];
$alt_state = $row['state'];
$alt_country = $row['country'];
echo "<CENTER><HR>". $alt_artistID." <BR>"
.$alt_firstname ." ".$alt_lastname ."</A><BR>"
.$alt_email."<B R>"
.$alt_city.", ".$alt_stat e." ".$alt_country. "<BR>
<A HREF=delete.php ?aritstID=".$al t_artistID.">DE LETE THIS
LISTING?</A><BR></CENTER>";
}
}
The second section is identical except for:
if ($searchemail !== "") {
$query="SELECT artistID,firstn ame,lastname,em ail,city,state, country
from artists WHERE email='$searche mail'";
etc...
}
I don't understand why I would get 6-8 records when you can look at them and
see that all but one clearly do not match...???
Wm
of these queries, although only one listing matches. I have a pair of forms
on one page:
<FORM>
Search for lastname: ____________ [Submit]
</FORM>
<FORM>
Search for email: _______________ _ [Submit]
</FORM>
This goes to a searchresults.p hp page:
if ($searchname !== "") {
$query="SELECT artistID,firstn ame,lastname,em ail,city,state, country
from artists WHERE lastname='$sear chname'";
$result=mysql_q uery($query) or die(mysql_error ("Could not execute
query."));
while($row = mysql_fetch_arr ay($result)) {
$alt_artistID = $row['artistID'];
$alt_firstname = $row['firstname'];
$alt_lastname= $row['lastname'];
$alt_email = $row['email'];
$alt_city = $row['city'];
$alt_state = $row['state'];
$alt_country = $row['country'];
echo "<CENTER><HR>". $alt_artistID." <BR>"
.$alt_firstname ." ".$alt_lastname ."</A><BR>"
.$alt_email."<B R>"
.$alt_city.", ".$alt_stat e." ".$alt_country. "<BR>
<A HREF=delete.php ?aritstID=".$al t_artistID.">DE LETE THIS
LISTING?</A><BR></CENTER>";
}
}
The second section is identical except for:
if ($searchemail !== "") {
$query="SELECT artistID,firstn ame,lastname,em ail,city,state, country
from artists WHERE email='$searche mail'";
etc...
}
I don't understand why I would get 6-8 records when you can look at them and
see that all but one clearly do not match...???
Wm
Comment