lord9999 Posted December 14, 2006 Report Share Posted December 14, 2006 ola, boa noite... gostaria de um script que retornase o numero de cadastros em uma detrerminada tabela do banco de dados... Quote Link to comment Share on other sites More sharing options...
0 Beraldo Posted December 14, 2006 Report Share Posted December 14, 2006 Select Count(*) as total From tabela;[]'s Quote Link to comment Share on other sites More sharing options...
0 lord9999 Posted December 14, 2006 Author Report Share Posted December 14, 2006 pera coloquei esse codigo dentro de <? ?> e não deu em nada... exatamente ond tenho que por?? Quote Link to comment Share on other sites More sharing options...
0 ESerra Posted December 14, 2006 Report Share Posted December 14, 2006 $sql = mysql_query("Select Count(*) as total From tabela"); $x = mysql_fetch_array($sql); $total = $x["total"]; echo $total; Pronto... Quote Link to comment Share on other sites More sharing options...
0 Beraldo Posted December 14, 2006 Report Share Posted December 14, 2006 $sql = mysql_query("Select Count(*) as total From tabela"); $x = mysql_fetch_array($sql); $total = $x["total"]; echo $total; Pronto... Ou até mais simples: $sql = mysql_query("Select Count(*) as total From tabela"); $total = mysql_result ($sql, 0, 'total'); []'s Quote Link to comment Share on other sites More sharing options...
Question
lord9999
ola, boa noite...
gostaria de um script que retornase o numero de cadastros em uma detrerminada tabela do banco de dados...
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.