Hey guys,
Thanks for the help. I'be made good progress with the script and with creating the data baewss in MySQL.
I have a question with one of my scripts, listed below. I have a routine that checks to see if the search name entered by the client is actually in the data base. The section with the error is below in between the dashed lines. I can't find the error. Any thoughts? $name is the search name passed from the calling *.htm page. The error occurs at line 92 which is at the very bottom of the script. But I've isolated the problem to the section between the dashed lines.
Thanks, gary
<HR width="100%" color=blue><br><br>
<?php
$user="tnevni";
$password="terraka";
$database="tnevni";
mysql_connect(mysqldb,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
mysql_query($query);
if ($name == "") {
echo "Please Enter Valid AGENT NAME . . . ";
echo "<a href=\"" . $redirectlink . "\">RETURN to MySQL Data Base</a><br>";
//echo "<HR width="100%" color=blue>";
mysql_close();
return;
}
$query="SELECT * FROM clients";
$result=mysql_query($query);
$num=mysql_numrows($result);
$status = "no";
$i=0;
while ($i < $num) {
$name_table = mysql_result($result,$i,"agent_name");
if ($name_table == $name) {
$status = "yes";
$i = $num; }
else {
++$i; }
if ($status == "no") {
echo "Agent Name NOT FOUND . . . ";
echo "<a href=\"" . $redirectlink . "\">RETURN to MySQL Data Base</a><br>";
//echo "<HR width="100%" color=blue>";
mysql_close();
return; }
echo "<b>Database Output [table | clients]</b><br><br>";
$query = "SELECT * FROM clients WHERE agent_name = '$name'";
$result=mysql_query($query);
$agency_name=mysql_result($result,$i,"agency_name");
$agency_telephone=mysql_result($result,$i,"agency_telephone");
$agency_telephone_800=mysql_result($result,$i,"agency_telephone_800");
$agency_fax=mysql_result($result,$i,"agency_fax");
$agency_address_1=mysql_result($result,$i,"agency_address_1");
$agency_address_2=mysql_result($result,$i,"agency_address_2");
$agency_city=mysql_result($result,$i,"agency_city");
$agency_state=mysql_result($result,$i,"agency_state");
$agency_postal_code=mysql_result($result,$i,"agency_postal_code");
$agency_website_url=mysql_result($result,$i,"agency_website_url");
$agent_name=mysql_result($result,$i,"agent_name");
$agent_direct_line=mysql_result($result,$i,"agent_direct_line");
$agent_mobile_line=mysql_result($result,$i,"agent_mobile_line");
$agent_other_line=mysql_result($result,$i,"agent_other_line");
$agent_email_current=mysql_result($result,$i,"agent_email_current");
$agent_email_new=mysql_result($result,$i,"agent_email_new");
$web_host_name=mysql_result($result,$i,"web_host_name");
$web_host_userid=mysql_result($result,$i,"web_host_userid");
$web_host_password=mysql_result($result,$i,"web_host_password");
echo "Agency Name: $agency_name <br>";
echo "Agency Telephone: $agency_telephone <br>";
echo "Agency Telephone 800: $agency_telephone_800 <br>";
echo "Agency Fax: $agency_fax <br>";
echo "Agency Address 1: $agency_address_1 <br>";
echo "Agency Address 2: $agency_address_2 <br>";
echo "Agency City: $agency_city <br>";
echo "Agency State: $agency_state <br>";
echo "Agency Postal Code: $agency_postal_code <br>";
echo "Agency Web Site: $agency_website_url <br>";
echo "Agent Name: $agent_name <br>";
echo "Agent Direct Line: $agent_direct_line <br>";
echo "Agent Mobile Line: $agent_mobile_line <br>";
echo "Agent Other Line: $agent_other_line <br>";
echo "Agent E-mail (Current): $agent_email_current <br>";
echo "Agent E-mail (New): $agent_email_new <br>";
echo "Web Host Name: $web_host_name <br>";
echo "Web Host UserID: $web_host_userid <br>";
echo "Web Host Password: $web_host_password <br><br>";
mysql_close();
?>
<br>
<a href="<?php echo $redirectlink ?>"> <?php echo $redirectname ?> </a><br><br><br>
<HR width="100%" color=blue>