I've written a small function in PHP, as follows: (I'm aware there isn't any security stuff in there yet)
Code: Select all
function sql($query)
{
include("config.common.php");
global $dbName;
@mysql_select_db($dbName) or die("<h1>Database Error</h1>Unable to connect to database");
$sql = "" . $query . "";
$result = mysql_query($sql);
define("result",$result);
unset($sql,$query);
}
Code: Select all
sql("SELECT * FROM table");
Code: Select all
$row['article_title'];
Any ideas?