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? Quote Link to comment Share on other sites More sharing options...
Spring Posted November 30, 2011 Share Posted November 30, 2011 function getCategoryName($cRow[0]) you don't call a function like that. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.