Общие > Базы данных

PHP & Mysql

(1/1)

Admin q3:
Как сделать так, если в таблице есть такие-то данные то сделать то-то если нет то другое пробывал так
   $bresult3 = mysql_query("select day from histor where (day=\'$data\') and (hid=\'$cid\') ");
   list($ciddate) = mysql_fetch_row($bresult3);
   $bresult4 = mysql_query("select day from histor where (day=\'$data\') and (hid=\'$bid\') ");
   list($biddate) = mysql_fetch_row($bresult4);

if ($ciddate=""):
      mysql_query("insert into histor values (NULL,\'$data\',\'$cid\',\'0\',\'0\',\'0\',\'0\') ");
endif;
      mysql_query("update histor set hsviews=hsviews+1 where (hid=$cid) and (day=\'$data\') ");
if ($biddate =""):
      mysql_query("insert into histor values (NULL,\'$data\',\'$bid\',\'0\',\'0\',\'0\',\'0\')");
endif;
     mysql_query("update histor set hviews=hviews+1 where (hid=$bid) and (day=\'$data\') ");


Britva:
mysql_num_rows

Навигация

[0] Главная страница сообщений

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 
Перейти к полной версии