guys well i have built a function which suppose to output a specific column from a table by a query i gave to it:
here is the code:
[php]
$content_query = $db->query(“SELECT * FROM tms_pages
WHERE id
= ‘{$page_id}’;”);
function page_content($input){
global $content_query;
if($input != NULL){
$content = mysql_fetch_array($content_query);
return $content[$input];
}
}
[/php]
now when i will try to output the function for example by calling the column name via the function i am using something like that:
[php]echo page_content(“name”)[/php]
everything is working excellent until this point, but when in the same file i try to output another column via the function it won’t.
for example:[php]echo page_content(“content”)[/php]
if i erase the page_content(“name”) the second one with the content will work.
soo… what’s the problem guys :(… why can’t i use the function twice? :-X