PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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.
<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";
}
}
?>
Last edited by Benjamin on Sat Apr 25, 2009 3:58 am, edited 1 time in total.
Reason:Added code tags
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?
<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";
}
}
?>
Last edited by Benjamin on Sun Apr 26, 2009 12:00 pm, edited 1 time in total.
Reason:Added code tags.