gratsami Posted June 30, 2013 Share Posted June 30, 2013 Hi, I've table called (rr) with 3 columns id int, name varchar 100, and cnt int. I wrote php code to loop each record depending on cnt: <?php $getAll = mysql_query("SELECT * FROM rr"); while ($v = mysql_fetch_array($getAll)){ for( $i=1; $i <= $v['cnt']; $i++ ){ echo $i ." - ". $v['name'] ." - ". $v['cnt'] . "<br />"; } } ?> I need to convert this code to MySQL command to get same result or creating a view with a same results. Can any body help me please? Thanks. 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.