Double click the second recordset and go to advanced view.
Set the SQL to;
SELECT * FROM record_list WHERE `member Name` = paramMemberName
In the parameters section, click the plus button to create a new parameter:
Name: paramMemberName
Type: Text
Default Value: - 1
Run Time value: $row_R1_RS['member_name']
Hi John, i did as you told me, but it still din't work... i think there must be some things wrong with my script.. and i had create a testing page to test it.
here is the whole page script:
<?php require_once('../Connections/c_conn.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;
}
}
mysql_select_db($database_c_conn, $c_conn);
$query_Product_RS = "SELECT * FROM R1 ORDER BY ID DESC";
$R1_RS = mysql_query($query_R1_RS, $c_conn) or die(mysql_error());
$row_R1_RS = mysql_fetch_assoc($R1_RS);
$totalRows_R1_RS = mysql_num_rows($R1_RS);
$colname_member_RS = "-1";
if (isset($row_R1_RS['member_name'])) {
$colname_member_RS = (get_magic_quotes_gpc()) ? $row_R1_RS['member_name'] : addslashes
($row_R1_RS['member_name']);
}
mysql_select_db($database_c_conn, $c_conn);
$query_member_RS = sprintf("SELECT * FROM member WHERE 'member_name' = %s", GetSQLValueString
($colname_member_RS, "text"));
$member_RS = mysql_query($query_member_RS, $c_conn) or die(mysql_error());
$row_member_RS = mysql_fetch_assoc($member_RS);
$totalRows_member_RS = mysql_num_rows($member_RS);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<p><?php echo $row_R1_RS['member_name']; ?></p>
<p><?php echo $row_member_RS['member_name']; ?></p>
</body>
</html>
<?php
it able to display "member_name" from R1_RS recordset, but can't display "member_name" from member_RS recordset... :(