Jump to content

Help with function...


Recommended Posts

I'm writing a function that will gather and organise data into an array. For some reason I keep getting "syntax error, unexpected '=' " when testing it...

 

	function organise($d){
	while($$d._ROW = mysql_fetch_array($$d)){
	$$d._START[$$d._COUNTER] = $$d._ROW['start'];
	$$d._END[$$d._COUNTER] = $$d._ROW['end'];
	$$d._ANSWER[$$d._COUNTER] = $$d._ROW['answer'];
	$$d._COUNTER++;
	}
}

Link to comment
https://forums.phpfreaks.com/topic/201825-help-with-function/
Share on other sites

But if I run that function multiple times with a different argument, I won't be able to use the variables I'm creating inside it because it will change each time...

 

Its not in the code that I've posted but I've declared them as global variables... the reason I used variable variables is because if I run organise ('ABC'); I need to be able to use $ABC_ROW later on...

Link to comment
https://forums.phpfreaks.com/topic/201825-help-with-function/#findComment-1058966
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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