My form and results are on one page.
If I use :
if ($Company) {
$query = "Select Company, Contact
From tblworking
Where ID = $Company
Order By Company ASC";
}
if ($Name ) {
$query = "SELECT *
FROM TBLWorking
WHERE Contact Like '%$Name%'
ORDER BY Contact";
}
$result = mysql_query($qu ery);
$number = mysql_numrows($ result);
for ($i=0; $i<$number; $i++) {
$CompanyName = mysql_result($r esult,$i,"Compa ny");
$ContactName = mysql_result($r esult,$i,"Conta ct");
Print "Company: $CompanyName";
Print "<P>Name: $ContactName";
}
As soon as I enter the page it searchs using $Name, even though I have not
entered any information.
This results in me getting a complete list printed on screen, with out me
having to search.
How do I get this to show just the form, then the form and the results ?
Thanks
If I use :
if ($Company) {
$query = "Select Company, Contact
From tblworking
Where ID = $Company
Order By Company ASC";
}
if ($Name ) {
$query = "SELECT *
FROM TBLWorking
WHERE Contact Like '%$Name%'
ORDER BY Contact";
}
$result = mysql_query($qu ery);
$number = mysql_numrows($ result);
for ($i=0; $i<$number; $i++) {
$CompanyName = mysql_result($r esult,$i,"Compa ny");
$ContactName = mysql_result($r esult,$i,"Conta ct");
Print "Company: $CompanyName";
Print "<P>Name: $ContactName";
}
As soon as I enter the page it searchs using $Name, even though I have not
entered any information.
This results in me getting a complete list printed on screen, with out me
having to search.
How do I get this to show just the form, then the form and the results ?
Thanks
Comment