PDA

View Full Version : Two forms... one database


kona72
11-05-2006, 04:58 PM
Hi All,

I have a bit of a conundrum and i am not sure i am going about this the right way. What i have is two forms... The fist on ecollects the person's very basic info... name, address, email.
That form when 'submitted' need to email to a specified perosn and also populate some fields on the DB. I am trying to use pass the hidden field to the next page which is linked to the sam db but has more info...

Here are the actual pages..
http://www.switzerauto.com/don_switzer_credit_application1.php

http://www.switzerauto.com/don_switzer_credit_application.php

here is the code for page one...

<?php require_once('Connections/switzerauto.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "credit_app_pt1")) {
$insertSQL = sprintf("INSERT INTO credit_app (rec_num, name, address, address2, email) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['rec_num'], "int"),
GetSQLValueString($_POST['name'], "text"),
GetSQLValueString($_POST['address'], "text"),
GetSQLValueString($_POST['address2'], "text"),
GetSQLValueString($_POST['email'], "text"));

mysql_select_db($database_switzerauto, $switzerauto);
$Result1 = mysql_query($insertSQL, $switzerauto) or die(mysql_error());

$insertGoTo = "don_switzer_credit_application.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_switzerauto, $switzerauto);
$query_rsCreditAppPt1 = "SELECT * FROM credit_app";
$rsCreditAppPt1 = mysql_query($query_rsCreditAppPt1, $switzerauto) or die(mysql_error());
$row_rsCreditAppPt1 = mysql_fetch_assoc($rsCreditAppPt1);
$totalRows_rsCreditAppPt1 = mysql_num_rows($rsCreditAppPt1);
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Don Switzer Credit Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body bgcolor="#CCCCCC" topmargin="0" marginheight="0">
<div align="center">
<table width="729" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

<tr>
<td width="729" height="199" valign="top"><div align="center">Don_Switzer_Auto_Sales_Inc.png</div>
<div align="center">
<script menumaker>document.write('<scr' + 'ipt src="camelot.js">'+'</scr'+'ipt>');/*img src="Camelot.png" moduleid="switzer auto 2 (project)\Camelot_off.xws"*/</script>
</div></td>
</tr>
<tr>
<td height="808" valign="top"><div align="center">
<p align="center"><font size="4" face="Times New Roman, Times, serif">

Instant Credit Approval</font></p>
<form action="<?php echo $editFormAction; ?>" method="POST" name="credit_app_pt1" id="credit_app_pt1">
<div align="center">
<table width="500" border="0" cellspacing="1" cellpadding="1">

<tr>
<td width="151" height="24" valign="top"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Name</font></div></td>
<td width="342" valign="middle"><input name="name" type="text" id="name" onBlur="MM_validateForm('Name','','R','Address1','','R','P hone_No','','R','Email','','RisEmail');return document.MM_returnValue" size="40">
<input name="rec_num" type="hidden" id="rec_num"></td>
</tr>
<tr>
<td height="24" valign="top"> <div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Street Address</font></div></td>
<td valign="middle"><input name="address" type="text" id="address" onBlur="MM_validateForm('Address1','','R');return document.MM_returnValue" size="40" maxlength="50"></td>
</tr>
<tr>
<td height="24" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">spacer.gif</font></td>
<td valign="top"><input name="address2" type="text" id="address2" size="40"></td>
</tr>
<tr>
<td height="24" valign="middle"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Phone</font></div></td>
<td valign="middle"><input name="phone_no" type="text" id="phone_no" onBlur="MM_validateForm('Phone_No','','R');return document.MM_returnValue" size="40"></td>
</tr>
<tr>
<td height="24" valign="middle"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Email</font></div></td>
<td valign="middle"><input name="email" type="text" id="email" onBlur="MM_validateForm('Email','','RisEmail');return document.MM_returnValue" size="40"></td>
</tr>
<tr>
<td height="143" colspan="2" valign="top"><div align="justify"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">

By submitting this application form, you certify that the
information you have provided herein is true and correct
to the best of your knowledge. You also authorize the Bank/Auto
Dealer to conduct a personal investigation, and by submitting
this form, you accept as notice in writing of and authorize
the obtaining of any information required that may be related
to this application, from any source to whom the Bank/Auto
Dealer may apply and each source is authorized to provide
the Bank/Auto Dealer with information. In addition, you
authorize the Bank/Auto Dealer to disclose, in response
to direct inquiries from any other lender or credit bureau,
any information concerning your loan and account that the
Bank/Auto Dealer considers appropriate and agreement is
made to release the Bank/Auto Dealer and save it harmless
from any claims, damages or otherwise arising from such
disclosure made by the Bank/Auto Dealer.</font></div></td>
</tr>
<tr>
<td height="21"></td>
<td></td>
</tr>
<tr>
<td height="26" colspan="2" valign="top"><div align="center">
<input type="submit" name="Submit" value="Submit">
</div></td>
</tr>
<tr>
<td height="69"></td>
<td></td>
</tr>
</table>
</div>
<input type="hidden" name="MM_insert" value="credit_app_pt1">
</form>


</p>


</p>


</p>


</p>


</p>


</p>


</p>


</p>


</p>


</p>
</div></td>
</tr>
<tr>
<td height="19"></td>
</tr>
</table>
</div>
</body>
</html>
<?php
mysql_free_result($rsCreditAppPt1);
?>



And here is the second page.... Lots o fileds...



<?php require_once('Connections/switzerauto.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$colname_rsCreditApp = "-1";
if (isset($_GET['rec_num'])) {
$colname_rsCreditApp = (get_magic_quotes_gpc()) ? $_GET['rec_num'] : addslashes($_GET['rec_num']);
}
mysql_select_db($database_switzerauto, $switzerauto);
$query_rsCreditApp = sprintf("SELECT * FROM credit_app WHERE rec_num = %s", GetSQLValueString($colname_rsCreditApp, "int"));
$rsCreditApp = mysql_query($query_rsCreditApp, $switzerauto) or die(mysql_error());
$row_rsCreditApp = mysql_fetch_assoc($rsCreditApp);
$totalRows_rsCreditApp = mysql_num_rows($rsCreditApp);
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Switzer Automotive</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
</head>
<body topmargin="0" bgcolor="#cccccc" marginheight="0">
<div align="center">
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0"
width="729">
<tbody>
<tr>
<td height="199" valign="top" width="729">
<div align="center">


Don_Switzer_Auto_Sales_Inc.png</p>
<script menumaker>document.write('<scr' + 'ipt src="camelot.js">'+'</scr'+'ipt>');/*img src="Camelot.png" moduleid="switzer auto 2 (project)\Camelot_off.xws"*/</script>
</div>
</td>
</tr>
<tr>
<td bgcolor="#ffffcc" height="1249" valign="top">
<div align="center">
<p align="center"><font
face="Verdana, Arial, Helvetica, sans-serif" size="4">

Instant Credit Application

</font><font face="Verdana, Arial, Helvetica, sans-serif"
size="4"><font color="#ff0000" size="1">TIP:</font><font size="1"> Use your TAB
key to move through the fields.</font></font></p>
<form action="" method="post" name="credit_app_pt2" id="credit_app_pt2">
<div align="left"></div>
<table bgcolor="#ffffcc" border="0" cellpadding="1"
cellspacing="1" width="500">
<tbody>
<tr>
<td colspan="2" height="24" valign="middle">
<div align="center"><font color="#ff0000"
face="Verdana, Arial, Helvetica, sans-serif" size="2">PERSONAL</font>
<input name="hiddenField" type="hidden" value="<?php echo $row_rsCreditApp['rec_num']; ?>">
</div>
</td>
</tr>
<tr>
<td height="24" valign="middle" width="247">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Confirm Email

</font></div>
</td>
<td valign="middle" width="287"><input name="email" type="text"
id="email" value="<?php echo $row_rsCreditApp['email']; ?>"></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">City</font></div>
</td>
<td valign="middle"><input name="city" id="city" size="46"
type="text"></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Province</font></div>
</td>
<td valign="middle"><input name="province" id="province"
size="46" type="text"></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Postal Code</font></div>
</td>
<td valign="top"><input name="postal_code"
id="postal_code" type="text"></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">How long at
present address?</font></div>
</td>
<td valign="top"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2"> <input
name="present_years" id="present_years" size="5"
type="text">
Years <input name="present_months"
id="present_months" size="5" type="text">
Months </font></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Date of Birth</font></div>
</td>
<td valign="middle"><input name="dob"
id="dob" type="text">
<font
face="Verdana, Arial, Helvetica, sans-serif" size="2">(dd/mm/yy)</font></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">S.I.N.</font></div>
</td>
<td valign="middle"><input name="sin" id="sin"
type="text"></td>
</tr>
<tr>
<td height="34" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Marital Status </font></div>
</td>
<td valign="top">


<font face="Verdana, Arial, Helvetica, sans-serif"
size="2"> <label> <input name="maritial" value="married"
type="radio">
Married</label> </font><font
face="Verdana, Arial, Helvetica, sans-serif" size="2"> <label> <input
name="maritial" value="single" type="radio">
Single</label>

<label> <input name="maritial" value="divorced"
type="radio">
Divorced</label> <label> <input name="maritial"
value="separated" type="radio">
Separated</label>

</font></p>
</td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Gender</font></div>
</td>
<td valign="middle">


<label> <font
face="Verdana, Arial, Helvetica, sans-serif" size="2"> </font> <font
face="Verdana, Arial, Helvetica, sans-serif" size="2"> <input
name="gender" value="male" type="radio">
Male</font></label> <font
face="Verdana, Arial, Helvetica, sans-serif" size="2"> <label> <input
name="gender" value="female" type="radio">
Female</label> </font>

</p>
</td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Landlord/Mortgage
Company</font></div>
</td>
<td valign="middle"><input
name="landlord_mortgage" id="landlord_mortgage"
size="46" type="text"></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Monthly Payment </font></div>
</td>
<td valign="middle"><input name="month_payment"
id="month_payment" type="text"></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Own or Rent?</font></div>
</td>
<td valign="middle"><input name="own_rent"
id="own_rent" type="text"></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Have you ever
been bankrupt?</font></div>
</td>
<td valign="middle">


<label> <font
face="Verdana, Arial, Helvetica, sans-serif" size="2"> <input
name="bankrupt" value="yes" type="radio">
Yes</font></label>
<font face="Verdana, Arial, Helvetica, sans-serif"
size="2"> <label> <input name="bankrupt"
value="no" type="radio">
No</label> </font>

</p>
</td>
</tr>
<tr>
<td height="72" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Previous Address

<font size="1">(If less than 2 years at present address)</font></font></div>
</td>
<td valign="middle"><textarea name="previous_address"
cols="35" rows="4" id="previous_address"></textarea></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">How long at
previous address?</font></div>
</td>
<td valign="top"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2"> <input
name="pre_add_yrs"
id="pre_add_yrs" size="5" type="text">
Years <input name="pre_add_mth"
id="pre_add_mth" size="5" type="text">
Months </font></td>
</tr>
<tr>
<td colspan="2" height="24" valign="middle">
<div align="center"><font color="#ff0000"
face="Verdana, Arial, Helvetica, sans-serif" size="2">EMPLOYMENT</font></div>
</td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Company Name</font></div>
</td>
<td valign="middle"><input name="company_name"
id="company_name" size="46" type="text"></td>
</tr>
<tr>
<td height="72" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Company Address</font></div>
</td>
<td valign="top"><textarea name="company_address"
cols="35" rows="4" id="company_address"></textarea></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Work Phone</font></div>
</td>
<td valign="middle"><input name="wk_phone"
id="wk_phone" type="text"></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Position</font></div>
</td>
<td valign="middle"><input name="position" id="position"
size="46" type="text"></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Employed</font></div>
</td>
<td valign="top"><input name="employ_yrs"
id="employ_yrs" size="5" type="text">
<font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Years
<input name="employ_mon" id="employ_mon"
size="5" type="text">
Months</font></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Taxed at Source?</font></div>
</td>
<td valign="middle">


<label> <font size="2"> <font
face="Verdana, Arial, Helvetica, sans-serif"> <input
name="tax_source" value="yes" type="radio">
Yes</font></font></label>
<font face="Verdana, Arial, Helvetica, sans-serif"
size="2"> <label> <input name="tax_source"
value="no" type="radio">
No</label> </font>

</p>
</td>
</tr>
<tr>
<td height="24" valign="top">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Monthly Income</font></div>
</td>
<td valign="top"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2"> <input
name="gr_month_income" id="gr_month_income" size="10"
type="text">
Gross <input name="net_month_income"
id="net_month_income" size="10" type="text">
Net</font></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Other Income</font></div>
</td>
<td valign="middle"><input name="other_income"
id="other_income" size="46" type="text"></td>
</tr>
<tr>
<td height="30" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Previous Employer

<font size="1">(If less than 2 years at present address)</font>
</font></div>
</td>
<td valign="middle"><input name="previous_employ"
id="previous_employ" size="46" type="text"></td>
</tr>
<tr>
<td height="72" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Address</font></div>
</td>
<td valign="middle"><textarea
name="prev_employ_addr" cols="35" rows="4"
id="prev_employ_addr"></textarea></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Phone</font></div>
</td>
<td valign="middle"><input name="prev_employ_phone"
id="prev_employ_phone" type="text"></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Position</font></div>
</td>
<td valign="middle"><input
name="prev_employ_position" id="prev_employ_position"
size="46" type="text"></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Employed how
long?</font></div>
</td>
<td valign="top"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2"> <input
name="prev_employ_yrs" id="prev_employ_yrs" size="5"
type="text">
Years <input name="prev_employ_mon"
id="prev_employ_mon" size="5" type="text">
Months</font></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Type of vehicle
you're looking for? </font></div>
</td>
<td valign="middle"><input
name="vehicle" id="vehicle"
size="46" type="text"></td>
</tr>
<tr>
<td height="24" valign="middle">
<div align="right"><font
face="Verdana, Arial, Helvetica, sans-serif" size="2">Where did you
hear about us?</font></div>
</td>
<td valign="middle"><input
name="hear_about_us" id="hear_about_us"
size="46" type="text"></td>
</tr>
<tr>
<td height="24" valign="top">spacer2.gif</td>
<td valign="top">spacer2.gif</td>
</tr>
<tr>
<td colspan="2" height="26" valign="middle">
<div align="center"> <input name="Submit"
value="Send Application Form" type="submit"> </div>
</td>
</tr>
<tr>
<td colspan="2" height="24" valign="top">spacer2.gif</td>
</tr>
</tbody>
</table>
</form>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
<?php
mysql_free_result($rsCreditApp);
?>


And the just for fun.. here is the SQL

-- phpMyAdmin SQL Dump
-- version 2.8.0.3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 05, 2006 at 11:53 AM
-- Server version: 5.0.21
-- PHP Version: 5.1.4
--
-- Database: `switzerauto`
--

-- --------------------------------------------------------

--
-- Table structure for table `credit_app`
--

CREATE TABLE `credit_app` (
`rec_num` int(11) NOT NULL auto_increment,
`name` varchar(75) NOT NULL,
`address` varchar(100) NOT NULL,
`address2` varchar(200) default NULL,
`phone` varchar(15) NOT NULL,
`email` varchar(50) NOT NULL,
`city` varchar(200) default NULL,
`province` varchar(50) default NULL,
`postal_code` varchar(12) default NULL,
`present_years` varchar(5) default NULL,
`present_months` varchar(5) default NULL,
`dob` varchar(10) default NULL,
`sin` varchar(20) default NULL,
`marital` varchar(20) default NULL,
`gender` varchar(12) default NULL,
`landlord_mortgage` varchar(50) default NULL,
`monthly_payment` varchar(50) default NULL,
`own_rent` varchar(50) default NULL,
`bankrupt` varchar(10) default NULL,
`previous_address` varchar(50) default NULL,
`pre_add_yrs` varchar(10) default NULL,
`pre_add_mth` varchar(10) default NULL,
`company_name` varchar(50) default NULL,
`company_address` varchar(150) default NULL,
`wk_phone` varchar(15) default NULL,
`position` varchar(25) default NULL,
`employ_yrs` varchar(10) default NULL,
`employ_mon` varchar(10) default NULL,
`tax_source` varchar(5) default NULL,
`gr_month_income` varchar(10) default NULL,
`net_month_income` varchar(10) default NULL,
`other_income` varchar(25) default NULL,
`previous_employ` varchar(75) default NULL,
`prev_employ_addr` varchar(150) default NULL,
`prev_employ_phone` varchar(15) default NULL,
`prev_employ_position` varchar(50) default NULL,
`prev_employ_yrs` varchar(5) default NULL,
`prev_employ_mon` varchar(5) default NULL,
`vehicle` varchar(100) default NULL,
`hear_about_us` varchar(50) default NULL,
PRIMARY KEY (`rec_num`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;