0

Hi guys i have problem regarding to display specific row record on the page.
I have one mysql table named as candidates. Its have 25 rows. I have a php page and i want to display the 20 no row on the page. What action to be done there. Plz help.

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by tomato.pgn
0

u can do this....not optimal solution but still will work......

<?php
$con=mysql_connect("localhost","root","");
$db=mysql_select_db("abc",$con);
$result=mysql_query("SELECT * from candidates");
$i=1;
while($rows=mysql_fetch_array($result))
{
if($i==20)
{
echo $rows['name']."<br/>";
}
$i=$i+1;
}
?>

Edited by tomato.pgn: n/a

0

another solution to this is using nested query although it will be not optimal if we want middle data...so that's y i came with earlier solution......
reply if it was helpful.....

Edited by tomato.pgn: n/a

0

I will try it my best if any query then i will reply you.
Can u tell me i use this as
select * from candidates where 'id'=5
it will work

0

is id an attribute????if yes then it will work....else...u can also do another thing to take an attribute and auto increment it....then ur query will work.....

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.