where would i find it? i am new to php here is the entire script
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<? include("header.php"); ?>
<?
/ $where=" where status=1 ";
if ($cid) $where.=" and cat_id=$cid ";
$order=" order by start_date";
$sql = "select from events $where $order $limit";
$item_list = get_query_list($conn, $sql);
*/
/Auto Delete /
$auto_delete_sql = "DELETE FROM events WHERE end_date<".time();
exec_sql($conn, $auto_delete_sql);
/Auto Delete End /
$table_name = "events";
$cid = $_GET["cid"];
$where=" where status=1 ";
//if($GET[weeknum] >= 0)
//{
$recurring = " and ((recurring='once') ";
$recurring .= " or (recurring='weekly' and recurring_day='".$GET[day]."') ";
$recurring .= " or (recurring='monthly' and recurring_day='".$GET[day]."' and recurring_week='". $GET[weeknum] ."')) ";
//}
//$where .= $recurring;
//date("Y-m-d", $edit_list[start_date]);
$date = explode("-",$_GET[event_date]);
$date = mktime(0,0,0,$date[1],$date[2],$date[0]);
if ($date>0)
{
$where.=" and start_date <= '$date' and end_date >= '$date' ";
$where .= $recurring;
}
if ($cid)
$where.=" and (cat_id=$cid or cat_id_2=$cid or cat_id_3=$cid or cat_id_4=$cid or cat_id_5=$cid) ";
/*************************************
handle page number & size
*************************************/
$submit_to=$_SERVER[REQUEST_URI];
$default_page_size = 10;
$total_page = 0;
if( !empty($POST["page_size"]) ) $page_size = $POST["page_size"];
if( ($POST["action"]=="pagesize") && !empty($POST["p_size"]) ) $page_size = $_POST["p_size"];
$total_rows = get_a_value($conn, "select count(*) from $table_name $where $limit");
if( $page_size < $default_page_size ) $page_size = $default_page_size;
if( $page_size > $total_rows ) $page_size = $total_rows;
if( ($page_size < 1) || empty($page_size) ) $page_size = $default_page_size;
if( empty($current_page) ) $current_page = 1;
if($POST["action"]=="lastpage") $current_page--;
if($POST["action"]=="nextpage") $current_page++;
if($POST["action"]=="gopage") $current_page = $POST["gopage"];
$total_page = ($total_rows - $total_rows % $page_size) / $page_size;
if ($total_page==0) $total_page=1;
if($total_rows % $page_size) $total_page++;
if($current_page < 1) $current_page = 1;
if($current_page > $total_page) $current_page = $total_page;
$start_row = ($current_page - 1) $page_size;
$limit=" LIMIT $start_row, $page_size";
/**************************************/
$order = " order by feature_flag desc, post_time desc ";
//echo $where;
$sql = "select from $table_name $where $order $limit";
$item_list = get_query_list($conn, $sql);
?>
<? include("member_top_menu.php");?>
<table width="897" align="center" cellspacing="4" style="margin-top: 2px">
<tr>
<td width="608" valign="top"><table width="600" align="center" cellpadding="5" style="border-bottom: 1px solid #a0c17a">
<tr>
<td><a href="index.php">Home</a> > Upcoming Events </td>
<td align="right"><a href="mailto:freeposts@partyheartyinto.com"><b>Click here to post an event for free!</b></a> </tr>
</table>
<table width="98%" align="center" style="margin-bottom: 5px">
<!-- <tr>
<td colspan="2" ><h2>Upcoming Events</h2></td>
</tr>
--> <tr>
<td width="100%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="right">
<? if ($total_page>1) include("include/front_page_control.php"); ?>
</div></td>
</tr>
<!-- Display list of events and -->
<?php
for( $i=0; $i<sizeof($item_list); $i++ ){
?>
<tr>
<td><table width="600" border="0" align="center" cellpadding="8" class="box_content1" cellspacing="0" style="border-top: 1px solid #ebf3d0">
<tr>
<th width="100"><a class="img_frame" href="event_detail.php?id=<?= $item_list[$i][id] ?>">
<img src="event_pictures/thumb_<?=$item_list[$i][picture_1st] ?>" width="100" height="100" /></a></th>
<td valign="top"><table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
<td ><strong class="yellow">
<a href="event_detail.php?id=<?= $item_list[$i][id] ?>"><?= $item_list[$i][name] ?></a>
</strong></td>
</tr>
<tr>
<td ><strong>Location: </strong>
<?= $item_list[$i][location] ?></td>
</tr>
<tr>
<td><strong>Evetnts start: </strong><? echo date("M. j, Y", $item_list[$i][start_date]) ?></td>
</tr>
<tr>
<td>
<? if($item_list[$i][recurring] == 'weekly'){ ?>
<strong>Every: </strong> <? echo $item_list[$i][recurring_day] ?>
<? }else if($item_list[$i][recurring] == 'monthly'){?>
<strong>Every: </strong>
<? if($item_list[$i][recurring_day]==1)
echo "First ";
else if($item_list[$i][recurring_day]==2)
echo "Second ";
else if($item_list[$i][recurring_day]==3)
echo "Third ";
else if($item_list[$i][recurring_day]==4)
echo "Fourth ";
echo $item_list[$i][recurring_day]. " Until ". date("Y-m-d", $item_list[end_date]) ;
?>
<?}?>
</td>
</tr>
<tr>
<td ><strong>Event description: </strong>
<?
$len = strlen($item_list[$i][description]);
$brief = substr($item_list[$i][description],0,100);
if($len>strlen($brief)) $brief .= "�";
echo $brief ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<? }?>
<tr>
<td><div align="right">
<? if ($total_page>1) include("include/front_page_control_2.php"); ?>
</div></td>
</tr>
</table></td>
</tr>
</table></td>
<td valign="top" >
<table id="evtcal" border="0" cellpadding="0" cellspacing="0" width="245" align="center">
<tbody>
<tr>
<td style="padding: 1px;" align="center" bgcolor="#99CC33" valign="top" width="245">
<div id="calendar"><!-- Dynamically Filled --></div>
</td>
</tr>
</tbody>
</table>
<br />
<table width="250" align="center" cellpadding="0" cellspacing="0" class="box_content" >
<tr>
<th height="24">Events Categories</th>
</tr>
<tr>
<td ><ul>
<?php
$sql="select name,id from events_category order by display_order desc, name";
$cat_list = get_query_list($conn, $sql);
for( $i=0; $i<sizeof($cat_list); $i++ ){
?>
<li><a href="event_list.php?cid=<?php echo $cat_list[$i][id];?>"><?php echo $cat_list[$i][name];?></a></li>
<? }?>
</ul></td>
</tr>
</table>
<table width="270" align="center" cellpadding="0" cellspacing="0" style="margin-top: 5px">
<?
$page_id=4;
$sql = "select from ads where page_id=$page_id and status=1 and type=0 order by display_order desc";
$item_list = get_query_list($conn, $sql);
if (!empty($item_list)) for($i=0; $i<sizeof($item_list); $i++) echo $item_list[$i][text_box1];
?>
<tr>
<td>
<object classid="clsid😃27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="270" height="75">
<param name="movie" value="r10.swf">
<param name="quality" value="high">
<embed src="r10.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="270" height="75"></embed>
</object> </td>
</tr>
<tr>
<td>
<?
$item = get_query_row($conn, "select from cms where status=1 and id=2");
echo $item[description];
?>
</td>
</tr>
</table> </td>
</tr>
</table>
<? include("footer.php"); ?>
<script language="JavaScript" type="text/javascript" src="js/events.js"></script>
<script>changedate('return');</script>