SQL.php

From Organic Design wiki
Revision as of 01:27, 23 February 2006 by Nad (talk | contribs) (tidy up)

<? $db =& wfGetDB( DB_MASTER );

  1. Get commands if admin

if ($GLOBALS['xwIsAdmin']) { if (xwGetProperty($properties, "xpath:$path/SQL", $sql)) { xwMessage("Attempting to execute SQL \"$sql\""); $result = $db->query($sql); # Render result rows as messages while ($row = mysql_fetch_assoc($result)) { $msg = ; foreach ($row as $k => $v) $msg .= "$k = $v, "; xwMessage($msg,'red'); } } } ?>