MySQL query working in phpmyadmin but not in PHP -


i've created mysql view expecting 2 parameters , i'm able query without problems in phpyadmin following sql-string:

set @date1 = '2014-02-06';  set @date2 = '2014-02-07';  select * _myquery  

it not work under php - i'm getting following error:

you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'set @date2 = '2014-02-07'; select * _myquery' @ line 2

when it's working in phpmyadmin, shouldn't work under php? idea what's wrong?

do need mysql variables? because select query not using them. can try with

select * _myquery 

but if need use mysql variables, take @ this:

mysql variables not working through php mysql query

mysql variables , php


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -