In Visual Basic I would do the following...
VB Code:
Public Function SetName(strFirstname as string, strLastname as string) as string SetName = strFirstname & " " & strLastname End Function 'Usage Msgbox SetName("Ben", "Everard")
The point being i would be able to set the function as a variable, so the value returned from the function can be used immediatly upon use.
The following PHP function (my first by the way) queries my MySQL database and recieves the last 5 entries into the news table.
Now currently it is being called and the function is simply writing the HTML code on each loop of the database query, what I need to happen is on each loop the HTML code to be added to a variable, and then after the loop has complete, return the variable to the function, just like the VB example did before.PHP Code:function sidebar_news($function_db, $function_limit, $function_directory_height) {
$global_news_content = mysql_query("SELECT * FROM tblNews ORDER BY date DESC LIMIT " . $function_limit, $function_db);
while ($global_news_content_row = mysql_fetch_row($global_news_content)) {
?>
<a href='<?php echo($function_directory_height); ?>/news.php'><?php echo($global_news_content_row[0]); ?></a><br>
<?php
}
}
Cheers my lovers
ILMV 1.0.1beta


) queries my MySQL database and recieves the last 5 entries into the news table.
Reply With Quote
