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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.