include("reg_adm/class/phplibs_mysql.php"); BaseConnect(); $abt=mysqli_query($connect, "SELECT * FROM reg_about WHERE pid=0 ORDER BY id_num"); $srv=mysqli_query($connect, "SELECT * FROM reg_services WHERE pid=0 ORDER BY id_num"); $cnt=mysqli_query($connect, "SELECT * FROM reg_cont WHERE pid=0 ORDER BY id_num"); // $hme=mysqli_query($connect, "SELECT * FROM reg_home WHERE pid=0 ORDER BY id_num LIMIT 1"); //$home=mysqli_fetch_assoc($hme); $ontop_sql= $sql="SELECT zagolovok, text, EXTRACT(DAY FROM data) as day, EXTRACT(MONTH FROM data) as month, EXTRACT(YEAR FROM data) as year, id FROM reg_news WHERE categor='ontop' ORDER BY data DESC"; $sql="SELECT zagolovok, text, EXTRACT(DAY FROM data) as day, EXTRACT(MONTH FROM data) as month, EXTRACT(YEAR FROM data) as year, id FROM reg_news ORDER BY data DESC LIMIT 6"; $res=mysqli_query($connect, $sql) or die(mysqli_error()); $ontop_res=mysqli_query($connect, $ontop_sql) or die(mysql_error()); ?>
while ($row_abt=mysqli_fetch_assoc($abt))
{
echo"".$row_abt['zagolovok']." "; } ?> |
while ($row_srv=mysqli_fetch_assoc($srv))
{
echo"".$row_srv['zagolovok']." "; } ?> |
while ($row_cnt=mysqli_fetch_assoc($cnt))
{
echo"".$row_cnt['zagolovok']." "; } ?> |
Предложения | ||||
Юридический адрес г. Москва | ||||
|
".$ontop_news['day']." ".$month[$ontop_news['month']]." ".$ontop_news['year']." ".$ontop_news['zagolovok']."
".substr(strip_tags($ontop_news['text'], ''), 0, 250)."...";
}
*/
while ($news=mysqli_fetch_assoc($res))
{
if (strlen($news['month'])==1){$news['month']="0".$news['month'];}
if (strlen($news['day'])==1){$news['day']="0".$news['day'];}
echo"
".$news['day']." ".$month[$news['month']]." ".$news['year']." ".$news['zagolovok']."
".substr(strip_tags($news['text'], ''), 0, 250)."...";
}
?>