SQL query not working; but works using Navicat
I get this error message from my sql query:
Parse error: syntax error, unexpected 'BB' (T_STRING), expecting ']' in /home3/tbmvent1/public_html/desk/build/webassist/mysqli/rsobj.php(246) : eval()'d code on line 3
The following sql query works when I run the query Navicat; I get the correct answer. However, when I run the query within your recordset I get the error mentioned above. Do you see anything that is keeping the page from loading and the query from running. Thx
<?php
$pab = new WA_MySQLi_RS("pab",$Connections,1);
$pab->setQuery("(SELECT
(SELECT COUNT(pa) as pabpct FROM bat WHERE (teamID = ? ) AND
(
(result = 'BB') OR
(result = 'HBP') OR
(result = '1B') OR
(move_run = '1') OR
(xbh = '1') OR
(OB = '1') OR
(result = 'Bunt') OR
(result = '2B') OR
(result = '3B') OR
(result = 'HR') OR
(result = 'SC-Fly') OR
(result = 'D3-Safe') OR
(result = 'SC-BNT') OR
(rbi > '0') OR
(result = 'ROE-No Out')
)) / (SELECT COUNT(pa) FROM bat))");
$pab->bindParam("i", "".(isset($_GET['teamID'])?$_GET['teamID']:"") ."", "-1"); //colname
$pab->execute();
?>