Hi there everyone
I have a problem which i hope you can help me solve. I havea a directory of phonenumbers which you can search in from a webpage. It works perfectly except from one thing. As it is now it will only show one entry
the While command doesn't seem to work well.
The problems started to occur when i developed that I didn't get any error message when the search returned an empty array. Therefore I inserted an if-command checking if the array is empty. I cannot find the mistake
appreciate any help!!!
if (($name) or ($search) or ($village)){
if ((mysql_fetch_array($result))==0){
echo"sorry no match!";
}
else {
while($rad=mysql_fetch_array($result)){
echo
'<table align="center" bgcolor="#333333" width="96%" border="0" cellspacing="0" cellpadding="0">
<tr align="left" valign="top">
<td width="10" valign="top" align="left"> <img src="pics/ulsmall.gif" width="10" height="8"></td>
<td bgcolor="#333333"><a href="allinfo.php?phone='.$rad[phone].'"><B>'.ucfirst($rad[name]).'</B></a>
<td valign="top" align="right"> <img src="pics/ursmall.gif" width="10" height="8"></td>
</tr>
<tr cellpadding="2" align="left" valign="top">
<td <td width="10" valign="bottom" align="left"></td>
<td bgcolor="#333333"><H2>'.ucwords($rad[adress]).' '.strtoupper($rad[village]).'</td>
<td valign="bottom" align="right" bgcolor="#333333" align="right"><H1>'.$rad[phone].' </td>
</tr>
<tr align="left" valign="top">
<td <td width="10" valign="bottom" align="left"> <img src="pics/dlsmall.gif" width="10" height="8"></td>
<td bgcolor="#333333"><H3>'.$rad[smallinfo].'<br><br></td>
<td valign="bottom" align="right" bgcolor="#333333" align="right"><img src="pics/drsmall.gif" width="10" height="8"></td>
</tr>
</table><BR>';
}
}
}