xwishmasterx Posted August 22, 2008 Share Posted August 22, 2008 Hello (Please have in mind that I'm a complete noob:-)) I need to display a simple multiplication, where a "row" count is a part of it: I have this piece that will show the number of rows: <? $rs1=mysql_query("select * from users where ref_by='$username'"); echo mysql_num_rows($rs1);?> <? How can I multply this result with eg. 4? <? $rs1=mysql_query("select * from users where ref_by='$username'"); echo mysql_num_rows($rs1);?> * 4 = ?????? <? Hope you get the idea :-) Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted August 22, 2008 Share Posted August 22, 2008 <?php $rs1=mysql_query("select * from users where ref_by='$username'"); $rows = mysql_num_rows($rs1); $multiplied = $rows * 4; echo "There are ".$rows." rows, or when multiplied by 4 there are ".$multiplied." rows!"; ?> Quote Link to comment Share on other sites More sharing options...
xwishmasterx Posted August 22, 2008 Author Share Posted August 22, 2008 EXCELLENT! :-) Thanks a bunch! Quote Link to comment Share on other sites More sharing options...
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.