Ok I went ahead and started over from scratch... http://www.homeloancorp.com/los/test.html - Here is an example of what I will be outputting (eventually) - By an LO specifying they are in the Corporate branch I would like the address fields to pull from the Corporate row in the branches table. Below is all of the information/code.
Let me know if you need ANYTHING else. Again, thank you SO MUCH for helping me.
Here are the CREATE's....
//Table with the loan officers
CREATE TABLE `los` (
`id` SMALLINT( 4 ) NOT NULL ,
`fname` VARCHAR( 20 ) NOT NULL ,
`lname` VARCHAR( 25 ) NOT NULL ,
`email` VARCHAR( 40 ) NOT NULL ,
`webid` VARCHAR( 25 ) NOT NULL ,
`cel` VARCHAR( 15 ) NOT NULL ,
`branch` VARCHAR( 30 ) NOT NULL ,
`bio` BLOB NOT NULL ,
PRIMARY KEY ( `id` )
)
//Table with all of the branches
CREATE TABLE `branches` (
`id` SMALLINT( 4 ) NOT NULL AUTO_INCREMENT ,
`name` VARCHAR( 40 ) NOT NULL ,
`address` VARCHAR( 40 ) NOT NULL ,
`city` VARCHAR( 25 ) NOT NULL ,
`state` VARCHAR( 2 ) NOT NULL ,
`zip` SMALLINT( 5 ) NOT NULL ,
`fon` VARCHAR( 12 ) NOT NULL ,
`fax` VARCHAR( 12 ) NOT NULL ,
`free` VARCHAR( 15 ) NOT NULL ,
PRIMARY KEY ( `id` )
);
I put 2 records in each table. Here is the code for http://ludachris.org/losoutput.php
<?
include("dbinf.inc.php");
mysql_connect($sqladdress,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="
SELECT *
FROM los
";
$result=mysql_query($query);
echo "<b><center>Current LO's</center></b><br><br>";
while ($row = mysql_fetch_array($result)){
echo '<b>'.$row['fname'].' '.$row['lname'].'</b>
<br>E-mail: '.$row['email'].'
<br>WebID: '.$row['webid'].'
<br>CEL: '.$row['cel'].'
<br>Branch: '.$row['branch'].'
<br>Bio: '.$row['bio'].'
<br><hr><br>';
}
mysql_close();
?>
Here is the code for http://ludachris.org/branchesoutput.php
<?
include("dbinf.inc.php");
mysql_connect($sqladdress,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="
SELECT *
FROM branches
";
$result=mysql_query($query);
echo "<b><center>Current Branches</center></b><br><br>";
while ($row = mysql_fetch_array($result)){
echo '<b>'.$row['name'].'</b>
<br>Address: '.$row['address'].'
<br>City: '.$row['city'].'
<br>ST: '.$row['state'].'
<br>Zip: '.$row['zip'].'
<br>FON: '.$row['fon'].'
<br>FAX: '.$row['fax'].'
<br>FREE: '.$row['free'].'
<br><hr><br>';
}
mysql_close();
?>