0

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.

1
Contributor
1
Reply
14
Views
3 Years
Discussion Span
Last Post by sundeep.gurroby
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.