forked from Frecuencio/sqlbuddy-php7
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathajaxquery.php
More file actions
38 lines (26 loc) · 750 Bytes
/
ajaxquery.php
File metadata and controls
38 lines (26 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/*
SQL Buddy - Web based MySQL administration
http://interruptorgeek.com/sql-buddy-ig-review/
ajaxquery.php
- used for a variety of ajax functionality - runs a background query
MIT license
Original : 2008 Calvin Lough <http://calv.in>
Reviewed : 2016 Carlos Martín Arnillas <https://interruptorgeek.com>
*/
include "functions.php";
loginCheck();
if (isset($db))
$conn->selectDB($db);
if (isset($_POST['query'])) {
$queryList = splitQueryText($_POST['query']);
foreach ($queryList as $query) {
$sql = $conn->query($query);
}
}
//return the first field from the first row
if (!isset($_POST['silent']) && $conn->isResultSet($sql)) {
$row = $conn->fetchArray($sql);
echo nl2br(htmlentities($row[0], ENT_QUOTES, 'UTF-8'));
}
?>