Welcome! Log In Create A New Profile

Advanced

Creating hyperlinks from data in database

Posted by 77843835AlexB 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar Creating hyperlinks from data in database
April 29, 2013 11:12AM
Almost finished. Just struggeling with the list.php where if you click on a course it should display all the student. That I get right, but now to get them to be displayed as hyperlinks. I can get that right in a way, but then I get only half of my data displayed from the database. confused smiley


My code like this gives me all my data without hyperlinks:
Language: PHP
while($selRow = mysql_fetch_array($result)){ echo "<tr>"; echo "<td>" . $selRow[';fname';] . " " . $selRow[';sname';]. "</td>"; echo "</tr>"; } echo "</table>";

My code like this, gives me the hyperlinks, but half of my data is not displayed. Although if I hover the mouse cursor over the link, it displays the name of the missing data from the database.

Language: PHP
echo "<td>" . "<a href=';student_man.php?id=>" . $selRow[';fname';] . " " . $selRow[';sname';]. "</a></td>";

I tried following the example from the book, but can't quite make sense of how they get to send an id in the url. This is the part necessary where you click on the name hyperlink of the registered student and it should display the student details.
avatar
Mac
Re: Creating hyperlinks from data in database
April 29, 2013 11:23AM
Language: PHP
//get student id from table and assign it to $id <a href=';student_man.php?id=$id>$fname $sname</a>
avatar Re: Creating hyperlinks from data in database
April 29, 2013 11:37AM
Awesome!! Thanks Mac!!! It's working now!!
Sorry, only registered users may post in this forum.

Click here to login