projects
/
cl7.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c682b3
)
ADD Un début de simplification de mysql_query() par query()
author
Greg Burri
<greg.burri@gmail.com>
Wed, 16 Sep 2009 15:44:36 +0000
(17:44 +0200)
committer
Greg Burri
<greg.burri@gmail.com>
Wed, 16 Sep 2009 15:44:36 +0000
(17:44 +0200)
php/mysql_tools.php
[new file with mode: 0644]
patch
|
blob
diff --git a/php/mysql_tools.php
b/php/mysql_tools.php
new file mode 100644
(file)
index 0000000..
918d6a9
--- /dev/null
+++ b/
php/mysql_tools.php
@@ -0,0
+1,15
@@
+<?php # encoding:utf-8
\r
+
\r
+# voir : http://us2.php.net/manual/en/function.func-num-args.php
\r
+
\r
+function query($query, $a, $b, $c, $d, $e)
\r
+{
\r
+ if ($a == null)
\r
+ return mysql_query($query);
\r
+ if ($b == null)
\r
+ return mysql_query(sprintf($query,
\r
+ is_string($a) ? mysql_real_escape_string($a) : $a
\r
+ ));
\r
+}
\r
+
\r
+?>
\ No newline at end of file