Jump to content

[SOLVED] Arrays and Fatal Errors


geudrik

Recommended Posts

<?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
Share on other sites

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