include('console/boot.php'); if (!is_numeric($_GET['section'])) { $_GET['section'] = '1'; } $sql = "select id,title,text,pic from services order by `order` asc"; $result = mysql_query($sql) or die($sql.mysql_error()); $rows = mysql_num_rows($result); $content = array(); $section_exists = false; $first_section = -1; if ($rows) { while ($row = mysql_fetch_assoc($result)) { if ($first_section==-1) { $first_section = $row['id']; } $content[] = $row; if ($row['id']==$_GET['section']) { $section_exists = true; } } } mysql_free_result($result); if (!$section_exists) { $_GET['section'] = $first_section; } $sql = "select name,value from data where name='mp_address' or name='mp_phone'"; $result = mysql_query($sql) or die($sql.mysql_error()); $rows = mysql_num_rows($result); if ($rows) { while ($row=mysql_fetch_assoc($result)) { $mp_data[$row['name']] = $row['value']; } } mysql_free_result($result); ?>