hi, below is a part of my code for a form that lets me view data. basically i want to be able to view data from 2 tables (members, payments) but for some reason it is not letting me. 'security_code' is what i want showing on the form along with the other member information and both tables have the same primary key. has anyone got any ideas on how i can fix the code
<html><head><title></title></head>
<body>
<?
$cid=$_POST['customer_id'];
$db="test";
//mysql_connect(localhost);
$link = mysql_connect("localhost");
if (! $link)
die("Couldn't connect to MySQL");
mysql_select_db($db , $link)
or die("Couldn't open $db: ".mysql_error());
$result1=mysql_query(" SELECT * FROM members WHERE customer_id='$cid' ");
$num=mysql_num_rows($result1);
$result2=mysql_query(" SELECT * FROM payment WHERE customer_id='$cid' ");
$num2=mysql_num_rows($result2);
$i=0;
while ($i < $num && $i < $num2) {
$email=mysql_result($result1,$i,"email");
$title=mysql_result($result1,$i,"title");
$house_number=mysql_result($result1,$i,"house_number");
$first_name=mysql_result($result1,$i,"first_name");
$second_name=mysql_result($result1,$i,"second_name");
$membership_valid=mysql_resul($result1,$i,"membership_valid");
$password1=mysql_result($result1,$i,"password1");
$notes=mysql_result($result1,$i,"notes");
$post_code=mysql_result($result1,$i,"postcode");
$security_code=mysql_result($result2,$i,"security_code");
?>
(html code goes here)
<?
++$i;
}
?>