Hi,
I am trying to execute the following query:
$QUERY1 = mysqli_prepare($db1->dbh, "SELECT Database, SS_type, YTD2009 from '$table1' where SS_type = '$ss_type'
UNION
SELECT Database, SS_type, YTD2010 from '$table2' where SS_type = '$ss_type' UNION
SELECT Database, SS_type, YTD2011 from '$table3' where SS_type = '$ss_type' GROUP by Database");
and warning/error I am seeing at the terminal is:
PHP Warning: mysqli_stmt_execute() expects parameter 1 to be mysqli_stmt, boolean given....
which is coming from the following code:
if(!mysqli_stmt_execute($QUERY1)){
$db1->showerror();
} else{
mysqli_stmt_store_result($QUERY1);
mysqli_stmt_bind_result($QUERY1, $Database, $SS_type, $YTD2009, $YTD2010, $YTD2011);
print<<<STARTHTML
...
...
The values I am using are:
$table1 = "2009Db1_SS_vendor1"
$table2 = "2010Db1_SS_vendor1"
$table3 = "2011Db1_SS_vendor1"
$ss_type = "Total Searches Run"
There appears to be a problem with my above SQL statement. Any suggestions on how to address it? Thanks.