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. Link to comment https://forums.phpfreaks.com/topic/279739-help-in-convert-php-code-to-mysql-command/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.