Page 1 of 1

parse error please help

Posted: Sat Apr 25, 2009 3:54 am
by dwilk28345
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/lionsclub/events.inc.php on line 20

I've been at it for hours trying to figure this out. :(


Code: Select all

 
<h2 align = "center">Lions Club Events</h2><br />
 
<?php
 
    $con = mysql_connect("localhost", "guest" , "guest") or die('sorry, the site database is down for maintanence');
    mysql_select_db("lionsclub", $con) or die('sorry, this portion of the site is down for maintanence');
    $query = "SELECT events,title FROM events ORDER BY events,eventid ASC
    $result = mysql_query($query) or die('Sorry, could not retrieve events at this time');
    $num_rows= mysql_num_row($result)
 
if ($num_rows == 0)
 
{
    echo '<h3>Sorry, no events posted at this time, please come back later</h3>';
 
}   else
{
    while($row=mysql_fetch_array($result, MYSQL_ASSOC))
    {
        $eventid = $row['eventid'];
        $title = $row['title'];
        $desc = $row['desc'];
        $sdate = $row['sdate'];
        $stime = $row['stime'];
        $edate = $row['edate'];
        $etime = $row['etime'];
        $club = $row['club'];
        $ocdesc = $row['ocdesc'];
 
        echo "$title $sdate, $stime $edate, $etime";
        echo "$shortdec";
        echo "$ocdesc";
    }
}
?>
 
 

Re: parse error please help

Posted: Sat Apr 25, 2009 11:16 am
by Daisy100
$num_rows= mysql_num_row($result);
(You missed the ; )

Re: parse error please help

Posted: Sun Apr 26, 2009 5:08 am
by dwilk28345
lol i spent 4 hours looking for that lol. Thanks


Topic is closed

now there is a new problem

It is not registering the query , it says that no posts can be found all though the posts are submitted and are in the mysql database, u name and pword is both guest for the account and in the code, I also have global privileges to add edit view delete and so on, any ideas?

Re: parse error please help

Posted: Sun Apr 26, 2009 5:21 am
by dwilk28345
here is the new code with the mysql problem. It only occurs when I leave SELECT desc, in the list of records to pull from the database.

Code: Select all

 
<h2 align = "center">Lions Club Events</h2><br />
 
<?php
 
    $con = mysql_connect("localhost", "guest" , "guest") or die('sorry, the site database is down for maintanence');
    mysql_select_db("lionsclub", $con) or die('sorry, this portion of the site is down for maintanence');
    $query = "SELECT eventid, title, desc, sdate, stime, edate, etime, club, ocdesc  FROM events ORDER BY eventid ASC";
    $result = mysql_query($query) or die('Sorry, could not retrieve events at this time');
 
if (mysql_num_rows($result) == 0)
 
{
    echo '<h3>Sorry, no events posted at this time, please come back later</h3>';
 
}   else
{
    while($row=mysql_fetch_array($result, MYSQL_ASSOC))
    {
        $eventid = $row['eventid'];
        $title = $row['title'];
        $desc = $row['desc'];
        $sdate = $row['sdate'];
        $stime = $row['stime'];
        $edate = $row['edate'];
        $etime = $row['etime'];
        $club = $row['club'];
        $ocdesc = $row['ocdesc'];
 
        echo "$title, $sdate, $stime $edate, $etime <br />";
        echo "$desc";
        echo "$ocdesc";
    }
}
?>
 
 

Re: parse error please help

Posted: Sun Apr 26, 2009 10:19 pm
by dwilk28345
wow this sucks, now it just displays the word desc no information from the database any other suggestions?

Re: parse error please help

Posted: Sun Apr 26, 2009 10:23 pm
by dwilk28345
never mind, i changed the name to shortdesc and it works now, thanks youall have been a great help.

Re: parse error please help

Posted: Sun Apr 26, 2009 10:26 pm
by dwilk28345
closed!!!!!!!!!!!!!!11