If I were to run a normal mySQL query that selects all nodes I would do this:
set @type='node'; select * from actions where type = @type;
but what if lets say I set
type to be something that doesn't exist for example
set @type=''; select * from actions where type = @type or 1=1;
This will then in return select everything regardless.
How do I do the same with db_query?
I thought just doing
db_query("select * from actions where type = :type or 1=1;", array(':type' => '')).fetchAll();
but that doesn't work. Any ideas? (notice that :type is equal to '' just like in the mySQL example)