geudrik Posted August 31, 2009 Share Posted August 31, 2009 <?php @define('IN_SPAAZZ', true); include('config.php'); database(1); // Make sure we arent trying to execute anything without being called properly... if(!isset($_GET['id'])) { die("This page must not be accessed directly..."); } // This ID is the ID for the given solar system..... $systemid = $_GET['id']; // SQL for pulling station information // stationTypeID used in reference to staOpperations // to get services at station // Variable for stationTypeID - $stTypeID // $stTypeID then references staStationTypes $get_stations = "SELECT officeRentalCost, stationTypeID, corporationID, stationName, reprocessingEfficiency, reprocessingStationsTake, opperationID FROM staStations WHERE solarSystemID = '$systemid' ORDER BY stationName"; // SQL for pulling solar system info... ehehehee $get_sysinfo = "SELECT itemID, itemName FROM eveNames WHERE itemID = '$systemid'"; // Set queried variables... $stations = mysql_query($get_stations); $system = mysql_query($get_sysinfo); //Master Array $sysInfo = array(); // Declair the variable to hold each array, containing all datumz... // Child Array - Holds station info - NOT SERVICES $info = array(); //Child Array - Holds operationservice ID's... $svcIDs = array(); // Child array - holds station services $staSvcs = array(); while ($rowsta = mysql_fetch_assoc($stations)) { $rentalCost = $rowsta['officeRentalCost']." ISK per 30 Days<br />"; $staTypeID = $rowsta['stationTypeID']."<br />"; $corpID = $rowsta['corporationID']."<br />"; $staName = $rowsta['stationName']."<br />"; $repoEffic = $rowsta['reprocessingEfficiency'] * 100 ."%<br />"; $repoStaTake = $rowsta['reprocessingStationsTake'] * 100 ."%<br /><br />"; // Need Op ID to reference staOpperationServices (opID -> ServiceID) then from staServices (ServiceID -> ServiceName) $opperationID = $rowsta['opperationID']; // Push data into the array $info in the following order... array_push($info, array("$staName", "$corpID", "$staTypeID", "$rentalCost" , "$repoEffic", "$repoStaTake", "$opperationID")); } foreach($info[6] as $key) { // SQL for grabbing service ID's based on $key $keyql = "SELECT serviceID FROM staOpperationServices WHERE opperationID = '$key'"; $keyqlres = mysql_query($keyql); while($rowz = mysql_fetch_assoc($keyqlres)) { $staSvcIds = $rowz['serviceID']; array_push(svcIDs, "$staSvcIds"); } } foreach($svcIDs[0] as $key) { $svcSql = "SELECT serviceName FROM staServices WHERE serviceID = '$key'"; $svcNameRes = mysql_query($svcSql); while($svRow = mysql_fetch_assoc($svcNameRes)) { $svcs = $svRow['serviceName']; array_push(staSvcs, array("$svcs")); } } // Push two child arrays (Services and Sta Info) into master array... Ignore ID array... array_push($sysInfo, $info, $staSvcs); print_r($sysInfo); database(0); ?> I am getting the following error: Fatal error: Only variables can be passed by reference in /home/geudrik/spaazz.net/tools.php/systeminfo.php on line 77 Line 77 is the following: <?php array_push(svcIDs, "$staSvcIds") ?> I know that it has something to do with the method that I'm trying to set my arrays up for, but I can't seem to find where I'm going wrong. Anyone have any suggestions? Link to comment https://forums.phpfreaks.com/topic/172602-solved-arrays-and-fatal-errors/ Share on other sites More sharing options...
mikesta707 Posted August 31, 2009 Share Posted August 31, 2009 missing the $ array_push($svcIDs, "$staSvcIds") [/php[ Link to comment https://forums.phpfreaks.com/topic/172602-solved-arrays-and-fatal-errors/#findComment-909842 Share on other sites More sharing options...
geudrik Posted August 31, 2009 Author Share Posted August 31, 2009 der, thanks But my arrays are afu'd... I should be getting a bunch more data dumping out than what I actually am getting. eg: [6] => ) [1] => Array ( [0] => Jita IV - Moon 10 - Caldari Business Tribunal Law School [1] => 1000033 [2] => 3871 [3] => 10000 ISK per 30 Days [4] => 50% [5] => 5% I should also be getting a bunch of services as well... Link to comment https://forums.phpfreaks.com/topic/172602-solved-arrays-and-fatal-errors/#findComment-909849 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.