Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Only returning first data record

Status
Not open for further replies.

mickyjune26

Technical User
Joined
Mar 26, 2002
Messages
270
Location
US
Would you be able to do me a small favor and troubleshoot a php problem I’m having? I'm new to php, but know HTML pretty well.

I’m having a problem with a form. When I hit submit, it doesn’t give me the Micky Fokken record.

It will give me this record if I put in Micky as contact name, but if I leave contact name blank, I think it’s just giving me the first record, joy, not all of them

It does weird stuff if I try top put in a wildcard (*) as the contact name. I'm guessing php isn't built for that.

It's a MySQL backend.

Here’s the website:


The site files are in the attachment, but the database is on the website listed above.

Thanks,
Micky


Sopht Solutions

Building Long-Term
IT Relationships. Everyday.
 
I'm not sure what site files are in what attachment. But it would be beneficial if you told us how you were trying to grab several records... From toying with the site a little it seems to me you're not looping to get anything beyond the first record.

Secondly, * is not a wild card in SQL, % is.

-Rob
 
Oh, sorry, I copied this message from someone that I origanally sent the message to.

After clicking the submit button, it goes to the results.php file. Is this the file that processes the query parameters?

Sopht Solutions

Building Long-Term
IT Relationships. Everyday.
 
No, search.php is processing your form, and then (apparently) sending you on to results.php

It could be one or both of these files that is set up to handle only one result.

It's very difficult to know what's happening by just looking at the output. If you want to look into your search.php and results.php and look for any loops, for or while... especially surrounding something like this..
Code:
$row = mysql_fetch_assoc($results);

or
$row = mysql_fetch_array($results);

You'll likely have your culprit.... but I'm doing alot of guessing.

-Rob
 
Thanks for your input, i'll be pretty busy this week but towards the end, i'll send some updates on the file contents.

Thank you,
Micky

Sopht Solutions

Building Long-Term
IT Relationships. Everyday.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top