megahard
Mon 10th Jun '02, 1:08pm
i have a function, and it needs the variable 'pid' to work.
// Function to take basic template and put the title and information into it
function displaypage($pid=-1){
global $queries;
if($pid != -1){
// Get page info
$queries->query("SELECT * FROM br_announce WHERE pid=$pid");
$info_array = mysql_fetch_array($queries->query);
// Get template
$queries->query("SELECT * FROM br_layouts WHERE lid=2");
$template = mysql_fetch_array($queries->query);
$pagetoecho = str_replace("<%title%>", $info_array[0], $template[1]);
$pagetoecho = str_replace("<%body%>", $info_array[1], $pagetoecho);
return $pagetoecho;
}
}
if i don't include the variable pid or it doesn't exist, then as i'd expect, the function does nothing.
but y does it stop everything below it?
echo displaypage($pid);
echo displaymenu();
echo displaynews();
it stops both displaymenu() and displaynews() from being executed
// Function to take basic template and put the title and information into it
function displaypage($pid=-1){
global $queries;
if($pid != -1){
// Get page info
$queries->query("SELECT * FROM br_announce WHERE pid=$pid");
$info_array = mysql_fetch_array($queries->query);
// Get template
$queries->query("SELECT * FROM br_layouts WHERE lid=2");
$template = mysql_fetch_array($queries->query);
$pagetoecho = str_replace("<%title%>", $info_array[0], $template[1]);
$pagetoecho = str_replace("<%body%>", $info_array[1], $pagetoecho);
return $pagetoecho;
}
}
if i don't include the variable pid or it doesn't exist, then as i'd expect, the function does nothing.
but y does it stop everything below it?
echo displaypage($pid);
echo displaymenu();
echo displaynews();
it stops both displaymenu() and displaynews() from being executed