Jump to content

[SOLVED] MySQL function isn't returning anything!


smc

Recommended Posts

Hello,

 

For some reason my code isn't returning anything to the page. After this code I've required my HTML template, and in the HTML template it has <?php echo_results(); ?> to call the function.

 

function echo_results() {
global $display;
$display = '
<img border=\"0\" src=\"../images/block.jpg\" width=\"9\" height=\"10\"><font size=\"2\"><b><br>" . [TITLE] . "</b></font><br />
';
$fido_rest = mysql_query("SELECT * FROM stories WHERE id != '$top_id' AND id != '$h1_id' AND id != '$h2_id' AND status = 'approved' AND section = '$section' ORDER BY date DESC")
			or die ( mysql_error() );
while ( $call = mysql_fetch_array($fido_rest) ) {
$title = $call['title'];
}
$temp = $display;
$temp = str_replace("[TITLE]", $title, $temp);

$results .= $temp;
return $results;
}

 

I replaced the sql function with ("SELECT * FROM stories WHERE status = 'approved'"); and that didn't work/return anything eithier.

 

I'm not getting any errors so I'm completly clueless. Help!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.