<!DOCTYPE html>
<html>
<head>
</head>
<body>
Applied Applicants :
<?php
$ID = mysql_query("Select AppID from staffapps where UserName") or die(mysql_error());
while($Applicant = mysql_fetch_assoc($SQL)) {
echo '<a style="color: black;text-decoration: none;" href="viewapplication?id='.$ID['AppID'].'">'.$Applicant['UserName'].'</a><br />';
}
?>
</body>
</html>
<?php
$ID = mysql_query("SELECT AppID FROM staffapps WHERE UserName") or die(mysql_error());
while($Applicant = mysql_fetch_assoc($ID)) {
echo '<a style="color: black;text-decoration: none;" href="viewapplication?id='.$ID['AppID'].'">'.$Applicant['UserName'].'</a><br />';
}
?>
Try this I fixed up the code just a tiny bit
PHP:<?php $ID = mysql_query("SELECT AppID FROM staffapps WHERE UserName") or die(mysql_error()); while($Applicant = mysql_fetch_assoc($ID)) { echo '<a rel="nofollow" style="color: black;text-decoration: none;" href="viewapplication?id='.$ID['AppID'].'">'.$Applicant['UserName'].'</a><br />'; } ?>
Ps I added you on skype
Select AppID from staffapps where UserName
SELECT `AppID` FROM `staffapps` WHERE `UserName` = "USERNAME";
<?php
$query = mysql_query("SELECT AppID, UserName FROM staffapps ORDER BY AppID DESC") or die(mysql_error());
while($row = mysql_fetch_assoc($query)) {
echo '<a style="color: black;text-decoration: none;" href="viewapplication?id='.$row['AppID'].'">'.$row['UserName'].'</a><br />';
}
?>
Your query doesn't make sense.
Code:Select AppID from staffapps where UserName
Select AppID from staffapps where UserName ... UserName is what?
You should try something like this:
Code:SELECT `AppID` FROM `staffapps` WHERE `UserName` = "USERNAME";
Also, please do not use mysql as it's deprecated. Switch to mysqli or PDO before it gets removed.
I'll rename the database with a underscore, yes the code works perfectly fine. However have you got any idea on how to fetch the other queries in the database to be echo-ed when clicked on the my Username such as RealName, Age, Timezone, Experience sort of? Thank you for your reply.Why using uppercases in database columns / tables? It is highly recommended not doing that and if you want to seperate words you should use an underscore '_'
Code:<?php $query = mysql_query("SELECT AppID, UserName FROM staffapps ORDER BY AppID DESC") or die(mysql_error()); while($row = mysql_fetch_assoc($query)) { echo '<a rel="nofollow" style="color: black;text-decoration: none;" href="viewapplication?id='.$row['AppID'].'">'.$row['UserName'].'</a><br />'; } ?>
This should return a list of links to the application. (Assumed your database structure is correct)
Change where it says - SELECT AppID, UserName FROM staffapps to - SELECT * FROM staffapps (or replace * with all your column names, example AppID, UserName etc etc)