Hi there, ok writing on database is very easy, but i don't know the following:--
1- When storing the links in the database, i want to get new link like this, domain.com/?link=89
where 89 represent row number where the link is stored??
2- when surfing the link, how can i read row 89 from the database and hyper a link with that link,
Please any reply, it will be really appreciated
regards
Although I don't directly know how to go straight to line 89, I do know that you could use a while loop then break the loop at line 89 then perform the actions with the fetched data. So try the following code to fetch each field of row 89 as an array.
<?
$result=mysql_query("SELECT * FROM `table`") or die(mysql_error());
$rownum=0;
while ($row=mysql_fetch_array($result))
{
$rownum+=1;
if ($rownum==89) //change 89 to row number to retrieve
{
break;
}
}
//now if you have a column named field1 and want to display
//its value on line 89 use the following
echo $row['field1'];
?>
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
Offline 3,004 posts
since Sep 2007