function GetSection($column){
if($column!=""){
if($column=="L"){
$position=0;
}elseif($column=="C"){
$position=1;
}elseif($column=="R"){
$position=2;
}
OpenDB();
$q="SELECT heading,body FROM sections WHERE active=1 AND position='$position' ORDER BY section_order ASC";
$r=mysql_query($q) or die (mysql_error());
$n=mysql_numrows($r);
while($row=mysql_fetch_array($r)){
BuildTable($row["heading"],$row["body"]);
echo "<br>"; // Spacer between sections
}
CloseDB();
}
}
[Resolved] Call to undefined function: getsection()
hmmm, not sure, maybe unquote the L in the parameter
Here is the deal. One minute it was working. I added another function called GetMenuBar() and that's when it starts to act funny. So I removed that function and it's acting like it is requiring the file but not actually loading the data from functions.php into the site to be accessible. Any ideas?
getmenubar doesn't have any opendb() or closedb() function calls does it, that may conflict, other than that, not sure
OpenDB() and CloseDB() are custom functions i made to simplify opening and closing db connections. those are also in the functions page attached is the functions.php.
you have this in your menubar function
ClosDB();
should be
CloseDB();
and you have those functions both in getsection and getmenubar, do you think those open and closes could be conflicting, like it opens in getsection and then getmenubar closes it, but you still need it open in getsection, you see what i mean, the overlapping, not sure if it is, but it could be
Unfortunately that wasn't it. I didn't notice the missing e in CloseDB so i added it and checked but that really doesn't matter.... I hadn't called GetMenuBar() so it wouldn't have made a call to the undefined function of ClosDB() (note the missing e). It is still acting like it hasn't loaded funcitons.php into the site even though it is required. I just get the error
Fatal error: Call to undefined function: getsection() in /home/lko/public_html/index.php on line 33
So it is just not calling the function that is included in functions.php which is required at the top of the page to ensure it is loaded.
Originally posted by lchelf
Fatal error: Call to undefined function: getsection() in /home/lko/public_html/index.php on line 33
is that the exact error?
shouldn't it be GetSection(), not getsection(), i notice it was GetSection in the original post, but you never know
Tried that. I think that when php outputs an error it puts everything in lower case. Also since I can copy the same functions to the top of the page and not require("functions.php") it works just fine.
have you tried include to see if it will generate any different errors
Hi,
there is an error:
while($row=mysql_fetch_array($r){
A ) is missing:
while($row=mysql_fetch_array($r)){
I have tried include and no changes.
thanx for spotting my syntax error
Originally posted by tsinka
Hi,
there is an error:
while($row=mysql_fetch_array($r){
A ) is missing:
while($row=mysql_fetch_array($r)){
That fixed it. Thanx so much. Don't I feel stupid. Thanx a lot eveyone. It was a brain scratcher for me.