$ C = mysql_num_rows (mysql_query ($ q));

0 Cevap php

Ben merak ediyorum eğer bu

$c = mysql_num_rows(mysql_query("select * from action_6_weekly where code='$code'"));

geçerli PHP olarak kabul edilir?

Yoksa aşağıdakileri yapmanız gerekiyor?

$r = mysql_query("select * from action_6_weekly where code='$code'");
$c = mysql_num_rows($r);

Bu ben aslında yapıyorum budur:

if($entry == '9')
    $c = mysql_num_rows(mysql_query("select * from action_6_5pts where code='$code'")) or die ('MYSQL ERROR: '.mysql_error().' in '.__FILE__.' on '.__LINE__.'.');
elseif($entry == 'a')
    $c = mysql_num_rows(mysql_query("select * from action_6_10pts where code='$code'")) or die ('MYSQL ERROR: '.mysql_error().' in '.__FILE__.' on '.__LINE__.'.');
else
    $c = mysql_num_rows(mysql_query("select * from action_6_weekly where code='$code'")) or die ('MYSQL ERROR: '.mysql_error().' in '.__FILE__.' on '.__LINE__.'.');

if($c > 0) 
    $waiting_for_reply = false;

0 Cevap