Jump to content

function call error


michaelk46

Recommended Posts

I am getting this error:

 

Parse error: syntax error, unexpected '[', expecting ')' in C:\xampp\htdocs\Work\Store\store.php on line 154

 

when I run the following code:

 

function categorySearch($sql)
	{
		$res = mysqli_query($this->conn,$sql);
		$this->results='<table>';
		while($cRow = mysqli_fetch_array($res))
			{
				function getCategoryName($cRow[0])
				$this->results .= '<tr><td style="border: thin solid #000000;">' . $this->cat_str . '</td></tr>';
			}
		$this->results.='</table>';
		return $this->results;

	}

 

Line 154 refers to this line:  function getCategoryName($cRow[0])

 

Can anyone see what the problem is?

 

 

Link to comment
https://forums.phpfreaks.com/topic/252128-function-call-error/
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.