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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.