FT3 Posted March 29, 2012 Report Share Posted March 29, 2012 (edited) Sveiki , ir radusies šada problēma. Query izvada lietotāju nick , un pec id izvada balvas id , bet tada problēma ka izvada tikai 1 balvas id , bet balvas ir vairakas <?php include('inc/connect.php'); $rpp = '23'; $adjacents = 4; $page = intval($_GET["page"]); if($page<=0) $page = 1; $reload = $_SERVER['PHP_SELF']; $sql = "SELECT * FROM `members` ORDER BY `member_id`"; $result = mysql_query($sql); $tcount = mysql_num_rows($result); $tpages = ($tcount) ? ceil($tcount/$rpp) : 1; $count = 0; $i = ($page-1)*$rpp; while(($count<$rpp) && ($i<$tcount)) { mysql_data_seek($result,$i); $query = mysql_fetch_array($result); $uid = $query['member_id']; $res_award = mysql_query("SELECT * FROM `inv_awards_awarded` WHERE `user_id` = '$uid'"); $award = mysql_fetch_array($res_award); echo ' <table> <tr> <td>'.$query['name'].'</td> <td>'.$award['award_id'].'</td> </tr> </table> '; $i++; $count++; } echo paginate_two($reload, $page, $tpages, $adjacents); ?> Edited March 29, 2012 by FT3 Quote Link to comment Share on other sites More sharing options...
Vecteevs Posted March 29, 2012 Report Share Posted March 29, 2012 Ideja ir šāda http://www.tizag.com/mysqlTutorial/mysqljoins.php Quote Link to comment Share on other sites More sharing options...
FT3 Posted March 29, 2012 Author Report Share Posted March 29, 2012 (edited) sorry nepareizi biju uzraksitjis , loabots veram ciet , izmantoju while.. Edited March 29, 2012 by FT3 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.