Jump to content

[SOLVED] Trouble getting data from assoc array


TGWSE_GY

Recommended Posts

Hi Guys,

 

I am not sure if this goes here in php or in mysql but I will try here first.

 

Here is my code

 

<?php session_start();
if (isset($_SESSION['Usr'])) {

	echo $CurrentStatus = $_POST['CurrentStatus'];
	echo "<br>";
	//Get Current Time
	require('curr_time.php');
	echo $time;
	echo "<br>";
	echo $varDate = date('m-d-y');
	echo "<br>";
	echo $varUser = $_SESSION['Usr'];

	// Connect to DB
	include('/home/thegayestever/thegayestcommunityever.com/projects/G/php/includes/configs/db_config.php');

	//Get CustID
	$varCustID = mysql_query("SELECT CustID FROM login WHERE Usr = '$varUsr'");
	$CustIDArray = mysql_fetch_assoc($varCustID);
	$CustID = $CustIDArray['CustID'];
	echo $CustID;
		if (mysql_num_rows($varCustID)) {
			//Insert Current Status into profile_current_member_status
			$varprevstatus = mysql_query("SELECT CurrentStatus FROM profile_current_status WHERE CustID = '$CustID'");
			$prevstatus = mysql_fetch_array($varprevstatus);
			echo $oldStatus = $prevstatus['CurrentStatus'];
			echo $oldDate = $prevstatus['Date'];
			echo $oldTime = $prevstatus['Time'];
			die();
		}
}
?>

 

I know the problem is in these 2 lines

		$CustIDArray = mysql_fetch_assoc($varCustID);
	$CustID = $CustIDArray['CustID'];

 

Its not getting the data from the assoc array....

But I just can't figure it out. Unsure of whats going on and I am sure it is a very basic problem but I am just not seeing it.

 

Thanks for the help guys.

 

 

HAPPY MEMORIAL DAY!!!!!!!!! 8) 8) 8) 8) 8) 8) ;D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.