Forum Moderators: coopster
I'm trying to output some content from a MySQL table using a while loop:
$query=mysql_query("SELECT * FROM table LIMIT 9");
while($result=mysql_fetch_array($query)) $mobile.="<a href=\"".$result["link"]."\">".$result["title"]."</a>";
Works great.
Now I'm trying to make it so I have an accesskey value that increases with each new link.
$query=mysql_query("SELECT * FROM table LIMIT 9");
while($result=mysql_fetch_array($query)){
$accesskey=1;
$mobile.="<a href=\"".$result["link"]."\" accesskey=\"".$accesskey."\">".$result["title"]."</a>";
$accesskey++;}
No luck.
How can I make it so each new row has a different accesskey?
Thanks
$query=mysql_query("SELECT * FROM table LIMIT 9");
$accesskey=1;
while($result=mysql_fetch_array($query)){
$mobile.="<a href=\"".$result["link"]."\" accesskey=\"".$accesskey."\">".$result["title"]."</a>";
$accesskey++;}
should work then