TGWSE_GY Posted May 25, 2009 Share Posted May 25, 2009 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) Link to comment https://forums.phpfreaks.com/topic/159580-solved-trouble-getting-data-from-assoc-array/ Share on other sites More sharing options...
.josh Posted May 25, 2009 Share Posted May 25, 2009 $varCustID = mysql_query("SELECT CustID FROM login WHERE Usr = '$varUsr'") or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/159580-solved-trouble-getting-data-from-assoc-array/#findComment-841728 Share on other sites More sharing options...
TGWSE_GY Posted May 25, 2009 Author Share Posted May 25, 2009 No error was returned. Link to comment https://forums.phpfreaks.com/topic/159580-solved-trouble-getting-data-from-assoc-array/#findComment-841735 Share on other sites More sharing options...
.josh Posted May 25, 2009 Share Posted May 25, 2009 you assign session var to $varUser but use $varUsr (no 'e') Link to comment https://forums.phpfreaks.com/topic/159580-solved-trouble-getting-data-from-assoc-array/#findComment-841737 Share on other sites More sharing options...
TGWSE_GY Posted May 25, 2009 Author Share Posted May 25, 2009 I see now thanks, sorry that was so simple I should have caught it. Link to comment https://forums.phpfreaks.com/topic/159580-solved-trouble-getting-data-from-assoc-array/#findComment-841781 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.