Skip to content
Advertisement

Getting a PDO query string with bound parameters without executing it

Is it possible to get a query string from a PDO object with bound parameters without executing it first? I have code similar to the following (where $dbc is the PDO object): Currently, this will echo out a SQL statement like: “SELECT * FROM users WHERE username = ?”. However, I would like to have the bound parameter included so

How to convert java.util.Date to java.sql.Date?

I am trying to use a java.util.Date as input and then creating a query with it – so I need a java.sql.Date. I was surprised to find that it couldn’t do the conversion implicitly or explicitly – but I don’t even know how I would do this, as the Java API is still fairly new to me. Answer tl;dr How

MySQL Query GROUP BY day / month / year

Is it possible to make a simple query to count how many records I have in a determined period of time like a year, month, or day, having a TIMESTAMP field, like: SELECT COUNT(id) FROM stats WHERE …

SQL Server – where is “sys.functions”?

SQL Server 2005 has great sys.XXX views on the system catalog which I use frequently. What stumbles me is this: why is there a sys.procedures view to see info about your stored procedures, but there …

Advertisement