Difference between revisions of "SQL.php"
From Organic Design wiki
m |
m |
||
(One intermediate revision by the same user not shown) | |||
Line 4: | Line 4: | ||
# Get commands if admin | # Get commands if admin | ||
if ($GLOBALS['xwIsAdmin']) { | if ($GLOBALS['xwIsAdmin']) { | ||
− | if (xwGetProperty($properties, " | + | if (xwGetProperty($properties, "SQL/query", $query)) { |
xwMessage("Attempting to execute SQL query \"$query\""); | xwMessage("Attempting to execute SQL query \"$query\""); | ||
$result = $db->query($query); | $result = $db->query($query); |
Latest revision as of 02:45, 18 March 2007
<? $db =& wfGetDB( DB_MASTER );
- Get commands if admin
if ($GLOBALS['xwIsAdmin']) { if (xwGetProperty($properties, "SQL/query", $query)) { xwMessage("Attempting to execute SQL query \"$query\""); $result = $db->query($query); # Render result rows as messages while ($row = mysql_fetch_assoc($result)) { $msg = ; foreach ($row as $k => $v) $msg .= "$k = $v, "; xwMessage($msg,'red'); } } } ?>