Member Avatar for sundeep.gurroby

Table 'user' fields:

UserID* (Primary Key)

Address

FirstName

LastName

Email

UserName

Password

UserLevel

RegDate

Table 'transaction' fields:

transactionID* (Primary Key)

MonthID

UserID (Foreign Key)

UserName

transactionDate

transactionType

transactionAmount

OpeningBalance

Balance

Desired output table (for the logged user):

transactionDate

transactionType

transactionAmount

OpeningBalance

Balance

Advance recordset details is like this :

<?php

if (!function_exists("GetSQLValueString")) {

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

{

if (PHP_VERSION < 6) {

$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_bankusers, $bankusers);

$query_Recordset1 = "SELECT transactions.UserName, transactions.transactionDate, transactions.transactionType, transactions.transactionAmount, transactions.OpeningBalance, transactions.EndBalance, users.FirstName, transactions.transactionID FROM transactions, users WHERE users.UserName = transactions.UserName ORDER BY transactions.UserName, transactions.transactionID DESC";

$Recordset1 = mysql_query($query_Recordset1, $bankusers) or die(mysql_error());

$row_Recordset1 = mysql_fetch_assoc($Recordset1);

$totalRows_Recordset1 = mysql_num_rows($Recordset1);

?>

This enables me to pull all the records from both tables but not specific to the logged user.

This is my problem. I would like the record to be pull is for the right user.

I am not sure if the the problem is to do with Session variable MM_UserName as I have no idea how to include it in the advanced recordset box but i am sure there is no missing session start on this page. Your help or suggestion will be much appreciated.

Member Avatar for sundeep.gurroby

I solved it with a simple recordset query in dreamweaver. so marking it solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.