epool Posted September 19, 2012 Share Posted September 19, 2012 First off, I apologize, I?ve never used a forum for help before and I appreciate any help you guys can give me. Script Info This script should be collecting data for each user and how many accounts they have opened up. Then it should figure out what office they belong to. Then give a total amount of accounts opened per office. This is the general goal. $thismonthFull = date("F", mktime(0, 0, 0, date("m"), date("d"), date("Y"))); $thismonth = date("m", mktime(0, 0, 0, date("m"), date("d"), date("Y"))); $thisyear = date("Y"); $START = "$thisyear-$thismonth-01"; $END = "$thisyear-$thismonth-31"; $query = mysql_query("SELECT * FROM `API` WHERE `ApprovalDate`>='$START' AND `ApprovalDate`<='$END'"); while($row = mysql_fetch_array($query)){ $ApprovalDate = $row['ApprovalDate']; $SalesRepFName = $row['SalesRepFName']; $SalesRepLName = $row['SalesRepLName']; trim($SalesRepFName); trim($SalesRepLName); $SalesRepName = "$SalesRepFName $SalesRepLName"; $OfficeNum = $row['OfficeNum']; $MerchantNumber = $row['MerchantNumber']; if($Stats[$SalesRepName] != NULL){ $Count = (int)$Stats[$SalesRepName]; $Count++; $Stats[$SalesRepName]="$Count"; } else{ $Stats[$SalesRepName]=1; } $Total++; } $query = mysql_query("SELECT * FROM `Users`"); while($row = mysql_fetch_array($query)){ $UID = $row['UID']; $AgentFname = $row['Fname']; $AgentLname = $row['Lname']; trim($AgentFname); trim($AgentLname); $AgentName = "$AgentFname $AgentLname"; $OfficeID = $row['OfficeID']; $AgentsOffice['$AgentName'] = "$OfficeID"; } $query = mysql_query("SELECT * FROM `Office_List`"); while($row = mysql_fetch_array($query)){ $ID = $row['ID']; $City = $row['City']; $State = $row['State']; $OwnerID = $row['OwnerID']; $Vanity[$ID] = $row['Vanity']; $Status = $row['Status']; $OfficeList[$ID] = "$City, $State"; } foreach($Stats as $key => $value){ $Office = $AgentsOffice['$key']; $Count = $OfficeStats['$Office']; $OfficeStats['$Office'] = $Count + $value; } foreach($OfficeStats as $key => $value){ $Office = $OfficeList[$key] . " " . $Vanity[$key]; echo "$Office $value<br />"; //Office reports blank and the value is reporting the total accounts opened. } Thanks again for any help! Quote Link to comment https://forums.phpfreaks.com/topic/268583-arrays-seem-to-break/ Share on other sites More sharing options...
jcbones Posted September 20, 2012 Share Posted September 20, 2012 Whats the question? Quote Link to comment https://forums.phpfreaks.com/topic/268583-arrays-seem-to-break/#findComment-1379482 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.