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.

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;
}
?>

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.....

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

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.....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.