Database
Currently only MySQL, MySQLi and PDO are supported, but it would be easy to add more.
IMPORTANT: Prepared statements are executed by this plugin!
Note that result sets are exhausted
after dumping them.
PDO can display the SQL statement as well, but this information cannot be retrieved from the older ways of querying DB's.
| *** Row *** | *** help_topic_id *** | *** name *** | *** help_category_id *** | *** description *** | *** example *** | *** url *** |
|---|---|---|---|---|---|---|
| *** 0 *** | 0 | JOIN | 6 | MySQL supports the following JOIN syntaxes for the *** length: 849 *** | mysql> SELECT table1.* FROM table1 -> L *** length: 127 *** | |
| *** 1 *** | 1 | HEX | 23 | HEX(N_or_S) If N_OR_S is a number, returns a s *** length: 337 *** | mysql> SELECT HEX(255); -> 'FF' mysql> SEL *** length: 124 *** | |
| *** 2 *** | 2 | REPLACE | 23 | REPLACE(str,from_str,to_str) Returns the string *** length: 130 *** | mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww'); -> 'WwWwWw.mysql.com' | |
| *** 3 *** | 3 | REPEAT | 23 | REPEAT(str,count) Returns a string consisting o *** length: 168 *** | mysql> SELECT REPEAT('MySQL', 3); -> 'MySQLMySQLMySQL' | |
| *** 4 *** | 4 | CONTAINS | 11 | Contains(g1,g2) Returns 1 or 0 to indicate whether or not g1 completely contains g2. |
Note that simply passing the result object/resource will not display error
messages comming from DB as the result set will be false
if the statement could not be executed (this is not true for PDO prepared statements).
But you can pass the connection object/resource
to get information about that, including any error message.
It's easier with prepared statements:
The same querys done with mysql-extension and a persistent connection:
| *** Row *** | *** help_topic_id *** | *** name *** | *** help_category_id *** | *** description *** | *** example *** | *** url *** |
|---|---|---|---|---|---|---|
| *** 0 *** | 0 | JOIN | 6 | MySQL supports the following JOIN syntaxes for the *** length: 849 *** | mysql> SELECT table1.* FROM table1 -> L *** length: 127 *** | |
| *** 1 *** | 1 | HEX | 23 | HEX(N_or_S) If N_OR_S is a number, returns a s *** length: 337 *** | mysql> SELECT HEX(255); -> 'FF' mysql> SEL *** length: 124 *** | |
| *** 2 *** | 2 | REPLACE | 23 | REPLACE(str,from_str,to_str) Returns the string *** length: 130 *** | mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww'); -> 'WwWwWw.mysql.com' | |
| *** 3 *** | 3 | REPEAT | 23 | REPEAT(str,count) Returns a string consisting o *** length: 168 *** | mysql> SELECT REPEAT('MySQL', 3); -> 'MySQLMySQLMySQL' | |
| *** 4 *** | 4 | CONTAINS | 11 | Contains(g1,g2) Returns 1 or 0 to indicate whether or not g1 completely contains g2. |
The same querys done with mysqli-extension:
| *** Row *** | *** help_topic_id *** | *** name *** | *** help_category_id *** | *** description *** | *** example *** | *** url *** |
|---|---|---|---|---|---|---|
| *** 0 *** | 0 | JOIN | 6 | MySQL supports the following JOIN syntaxes for the *** length: 849 *** | mysql> SELECT table1.* FROM table1 -> L *** length: 127 *** | |
| *** 1 *** | 1 | HEX | 23 | HEX(N_or_S) If N_OR_S is a number, returns a s *** length: 337 *** | mysql> SELECT HEX(255); -> 'FF' mysql> SEL *** length: 124 *** | |
| *** 2 *** | 2 | REPLACE | 23 | REPLACE(str,from_str,to_str) Returns the string *** length: 130 *** | mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww'); -> 'WwWwWw.mysql.com' | |
| *** 3 *** | 3 | REPEAT | 23 | REPEAT(str,count) Returns a string consisting o *** length: 168 *** | mysql> SELECT REPEAT('MySQL', 3); -> 'MySQLMySQLMySQL' | |
| *** 4 *** | 4 | CONTAINS | 11 | Contains(g1,g2) Returns 1 or 0 to indicate whether or not g1 completely contains g2. |
As prepared statements in mysqli work differently from PDO, it is not possible to have the nice error messages here. Also, I haven't found a way to display the column names. Any idea would be appreciated.
| *** Row *** | *** 0 *** | *** 1 *** | *** 2 *** | *** 3 *** | *** 4 *** | *** 5 *** |
|---|---|---|---|---|---|---|
| *** 0 *** | 1 | HEX | 23 | HEX(N_or_S) If N_OR_S is a number, returns a s *** length: 337 *** | mysql> SELECT HEX(255); -> 'FF' mysql> SEL *** length: 124 *** | |
| *** 1 *** | 2 | REPLACE | 23 | REPLACE(str,from_str,to_str) Returns the string *** length: 130 *** | mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww'); -> 'WwWwWw.mysql.com' | |
| *** 2 *** | 3 | REPEAT | 23 | REPEAT(str,count) Returns a string consisting o *** length: 168 *** | mysql> SELECT REPEAT('MySQL', 3); -> 'MySQLMySQLMySQL' | |
| *** 3 *** | 9 | CONCAT | 23 | CONCAT(str1,str2,...) Returns the string that r *** length: 385 *** | mysql> SELECT CONCAT('My', 'S', 'QL'); -> *** length: 159 *** | |
| *** 4 *** | 11 | CHAR FUNCTION | 23 | CHAR(N,...) CHAR() interprets the arguments as *** length: 178 *** | mysql> SELECT CHAR(77,121,83,81,'76'); -> *** length: 110 *** |