help on links

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

help on links

Post by pleigh »

hi, something is messing with my code

Code: Select all

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
		//$sid = $_GET['studentid'];
		echo '<tr><td align="left"><a href="info.php?sid={$row[0]}" class="under">' . stripslashes($row[1]) . '</td>
			  <td align="left">' . $row[2] . '</td></tr>';
	}
the above code should show the records and the name should be a link and when it is clicked, i can view the content...unfortunately, when i move my mouse over a link, the status shows the location of the link to "info.php?sid={$row[0]}" instead of showing the studentid in $row[0]...pls help..
shneoh
Forum Commoner
Posts: 38
Joined: Mon Sep 25, 2006 2:23 am
Location: Malaysia

Re: help on links

Post by shneoh »

Change to this:

Code: Select all

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
		//$sid = $_GET['studentid'];
		echo '<tr><td align="left"><a href="info.php?sid='.$row[0].'" class="under">' . stripslashes($row[1]) . '</td>
			  <td align="left">' . $row[2] . '</td></tr>';
	}
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

Post by pleigh »

perfect dude...thanks.:)
Post Reply