michaelk46 Posted November 30, 2011 Share Posted November 30, 2011 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 More sharing options...
Guest Posted November 30, 2011 Share Posted November 30, 2011 function getCategoryName($cRow[0]) you don't call a function like that. Link to comment https://forums.phpfreaks.com/topic/252128-function-call-error/#findComment-1292624 Share on other sites More sharing options...
michaelk46 Posted November 30, 2011 Author Share Posted November 30, 2011 Can't believe I missed that... Thanks Link to comment https://forums.phpfreaks.com/topic/252128-function-call-error/#findComment-1292628 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.