Code:
<?php
function db_connect(){
mysql_connect("localhost","username","pass");
mysql_select_db("database");
}
function get_media_info($category, $id){
db_connect();
$re = mysql_query("SELECT * FROM '$category' WHERE id='$id'");
$r = mysql_fetch_array($re);
$title = $r['title'];
$description = $r['description'];
$file = $r['file'];
$author = $r['author'];
$authorurl = $r['authorurl'];
$rating = $r['rating'];
$tags = $r['tags'];
}
get_media_info('movies', '5');
print $title;
?>
Now a bunch of code has been ommitted in between, but it was simply html stuff for layout purposes.
This script isn't too complex, but I'm returning this error on execution whenever I try to print values such as $title:
Code:
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --