problem during data fetch

Posted by nectar on Stack Overflow See other posts from Stack Overflow or by nectar
Published on 2010-05-28T06:58:34Z Indexed on 2010/05/28 7:01 UTC
Read the original article Hit count: 167

Filed under:
|

here is my code

$sql="SELECT * FROM $tbl_name WHERE ownerId='$UserId'"; $result=mysql_query($sql,$link)or die(mysql_error());
$row = mysql_fetch_array($result, MYSQL_ASSOC);

<?php
                                    while($row = mysql_fetch_array($result, MYSQL_ASSOC))
                                        {
                                            echo "<tr>";
                                            echo "<td>".$row['pinId']."</td>";
                                            echo "<td>".$row['usedby']."</td>";
                                            echo "<td>".$row['status']."</td>";
                                            echo "</tr>";
                                        }
                                    ?>

it is ignoring the first record means if 4 rows are in $row its ignoring the 1st one rest three are coming on page. ownerId is not primary key.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql