On Sat, 16 Aug 2003 23:54:57 GMT, "Wm" <LAshooter@hotmail.com> wrote:
>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.php page:
>
> if ($searchname !== "") {
> $query="SELECT artistID,firstname,lastname,email,city,state,count ry
>from artists WHERE lastname='$searchname'";
> $result=mysql_query($query) or die(mysql_error("Could not execute
>query."));
[snip]
> }
>
>The second section is identical except for:
> if ($searchemail !== "") {
> $query="SELECT artistID,firstname,lastname,email,city,state,count ry
>from artists WHERE email='$searchemail'";
> 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...???
Can you post a sample of the data that demonstrates this? The SQL queries (as
they're being executed, i.e. with the values filled in, not just a variable)?
Show the query returning unexpected rows from a mysql command prompt?
--
Andy Hassall (andy@andyh.co.uk) icq(5747695) (
http://www.andyh.co.uk)
Space: disk usage analysis tool (
http://www.andyhsoftware.co.uk/space)