This is a discussion on "Problem with results of form" within the PHP Forum section. This forum, and the thread "Problem with results of form are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Problem with results of form
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Problem with results of form
Here is the bare bones of a PHP form that I've cobbled together.
It works fine if the results are true. The information is shown perfectly. The problem comes when the results are not found. Instead of showing the 'error' message on screen it shows the top of the 'found' bit and no content below that. I'm assuming that I've missed out something very simple - but I can't see it. Can anyone help?
|
|
|
|
|||
|
Re: Problem with results of form
If something isn't found, you'll still get back a true result but an empty result set - that's what you're seeing. What you're checking for is an erroneous piece of SQL which won't be the case - you'll have a correct piece of SQL but one that retruns no records.
Suggestion ... add a counter within your while loop that fetches queries back, and if that counter still has a zero value when you finish the loop, output your "no match" message. |
![]() |
| Tags |
| form, null, php, problem, result |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Publicly viewable form results? | wealthy199 | Starting Out | 5 | Sep 27th, 2007 14:59 |
| Getting form results to email as an .html | griffster122 | Starting Out | 1 | May 29th, 2007 01:44 |
| Viewing form results ??????? | cat101 | PHP Forum | 3 | Apr 25th, 2006 23:57 |
| PHP form results $PHP_self is blank | jamina1 | PHP Forum | 17 | Sep 23rd, 2005 16:13 |
| Submitting Web form results to a database | theproman23 | Databases | 2 | Jun 30th, 2005 13:21 |