Просмотр поста

.
bleakas

конечно быдлокод, но немогу найти ошибку

<?php

/**
 * @author 
 * @copyright 2012
 */
if (!$db=mysql_connect('localhost','db_j2meground','ehyYYdwC')){
 echo 'sdsdas';}
  if (!mysql_select_db('db_j2meground')){ echo 'db!!!';}
  $res=mysq_query("select * from `aa` where `soo`");
  if (mysql_num_rows($res)==o){
    echo('<br>no messeges<br>');
  }
  else {
  $soo=  mysql_query("select * from  `aa`");
  while ($pole=mysql_fetch_array($soo)){
    echo '<br><br>'.$pole[0].'<br>'.$pole[1];
  }}
  echo '<br><br>
  <form action=gb.php method=post>
  <input type=text name=nik>
  <textarea rows=20 cols=20 name=text><textarea>
  <input type=submit></form>
  ';
  $text=$_POST['text'];
  $nik=$_POST['nik'];
  if ((isset ($text)) and (isset ($nik)) ){
 $text=mysql_real_escape_string($text);
     $nik=mysql_real_escape_string($nik);
    if ( mysql_query("insert into `aa` values ('$text', '$nik')")){echo 'enabled!!';}
     
  }
  
  
?>