My head is sore from banging my head on my desk, so I will now ask
the gurus...

        I am trying to get a canned Calendar application working, and I am
running into problems.  The application is phpCommunityCalendar by  The calendar is currently semi-functional, but for some
reason the approval system is not working for me.  I am trying to
troubleshoot why this is the case and this is where I am running into
problems.  The following is a bit of code that I do not understand and was
hoping that someone could clear up for me.

** < Not sure exactly what this code does, especially the %% portion>**

        if (!$glbl_LocationID) {
        $glbl_LocationID = "0";
        $LocQuery = "LocationID LIKE '%%'";
        } else {
        $LocQuery = "LocationID = '$glbl_LocationID'";

**  SNIP <This section queries the database for events that have been
submitted but NOT approved, this is the Active = '0'>**

$result = mysql("$DBName","SELECT CalendarDetailsID FROM phpCalendar_Daily
WHERE Active = '0'") or die(mysql_error());
        while ($row = mysql_fetch_row($result)) {
        $ID[$i] = $row[0];

** SNIP <Based on looking at the DB, this section associates the matched
item descriptions for display>**

        for ($j = 0; $ID[$j]; $j++) {
        $query .= " OR CalendarDetailsID = '$ID[$j]'";
$query = ereg_replace("^ OR ","",$query);
        if (!$query) {
        echo "<center><b>There are no results to display</b></center>";

** SNIP <Even though I see entries in the DB that appear as they should
display (Active = 0), nothing actually appears>**
$result = mysql("$DBName","SELECT *
FROM phpCalendar_Details
WHERE ".$LocQuery." AND (".$query.")
ORDER BY Title") or die(mysql_error());

        OK.  I have tested the basics of the SQL in both the second section
and the last section.  If I manually query the database as in the second
section, and then use that output in the query of the last section I am
returned a record as expected.  This is the reason why I am lost as to why
this is not working here.
        Thanks in advance for the help.

Scott Nipp
Phone:  (214) 858-1289
Web:  http:\\

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to