Jump to content

[SOLVED] function not returning data


graham23s

Recommended Posts

Hi Guys,

 

made a basic function here to return the name and id of a forum:

 

     function get_forum_name($forumid) {
     
     $forum_query = "SELECT * FROM `forum_sections` WHERE `id`='$forumid'";
     $forum_result = mysql_query($forum_query) or die (mysql_error());
     $forum = mysql_fetch_array($forum_result) or die (mysql_error());
     
     $for_id = $forum['id'];
     $for_name = $forum['forum_name'];
     
     return;
          
     }

 

call the function:

 

get_forum_name($forumid);

 

iv tested the code on the main page it works fine but when called it returns nothing not sure how that is

 

cheers

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/65513-solved-function-not-returning-data/
Share on other sites

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.