I'm learning php and mysql at the moment and I'm working on getting my current website to be dynamic.
I've looked at some guides and worked on my own code and to my knowledge I believe it should work, but when I check it online it does nothing.
Is there anything obvious I have missed in the code below, and is there anyway to display errors in php which would help me discover what I've done wrong?
<?
function functions($method, $query) {
$con = mysql_connect("hostname","username","password");
mysql_select_db("databasename", $con) or die(mysql_error());
if($method = 'get') {
$result = mysql_query($query);
return $result;
echo $result;
}
if($method = 'send') {
$result = mysql_query($query);
}
}
$query = "SELECT * FROM 'content' where 'ID' = 1";
$heading = functions('get', $query);
?>
<h1><?php echo $heading;?></h1>