Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
d1b2125b
Commit
d1b2125b
authored
Jun 23, 2002
by
Dries
Browse files
- Added the improved db_query() function with timings from Marco's sandbox.
parent
08b82913
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/database.mysql.inc
View file @
d1b2125b
...
...
@@ -40,11 +40,19 @@ function _db_query($query, $debug = 0) {
global
$queries
;
if
(
variable_get
(
"dev_query"
,
0
))
{
$queries
[]
=
$query
;
list
(
$usec
,
$sec
)
=
explode
(
" "
,
microtime
());
$timer
=
(
float
)
$usec
+
(
float
)
$sec
;
}
$result
=
mysql_query
(
$query
);
if
(
variable_get
(
"dev_query"
,
0
))
{
list
(
$usec
,
$sec
)
=
explode
(
" "
,
microtime
());
$stop
=
(
float
)
$usec
+
(
float
)
$sec
;
$diff
=
$stop
-
$timer
;
$queries
[]
=
array
(
$query
,
$diff
);
}
if
(
$debug
)
{
print
"<p>query:
$query
<br />error:"
.
mysql_error
()
.
"</p>"
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment