i want some advice on how to show the username from the ID, so I currently have this
<div id="container">
<aside>
<?php
if (logged_in() === TRUE ) {
include '../includes/widgets/loggedin.php';
} else {
include '../includes/widgets/login.php';
}
include('../includes/widgets/user_count.php');
?>
</aside>
<h1>Admin</h1>
<p>Welcome please update select a module to update from the table below</p>
<div id="allresult">
<?php
$sql = "SELECT * FROM lr_programme WHERE user_id =" . $_SESSION['user_id']; //select statement to show in a table doesnt show the publisher
$queryresult = mysql_query($sql)
or die(mysql_error());
echo "<table id='results'>";
echo "<thead>";//teable head for stucture
echo "<tr>\n";
echo "<th><strong>Programme Code</strong></th>\n";//shows the table headings
echo "<th><strong>Programme Name</strong></th>\n";
echo "<th>Programme Tutor</th>\n";
echo "<th>Programme Desc</th>\n";
echo "<th>Programme Link</th>\n";
echo "</tr>\n";
echo "</thead>";
while ($row = mysql_fetch_assoc($queryresult)) {
$prog_id = $row['prog_id'];
$prog_name = $row['prog_name'];
$user_id = $row['user_id'];
$prog_desc = $row['prog_desc'];
$prog_link = $row['prog_link'];
echo "<tbody>
<tr>
<td> <a href=\"updateProgInfo.php?prog_id=$prog_id\">$prog_id</a></td>
<td> $prog_name </td>
<td> $user_id </td>
<td> $prog_desc </td>
<td> $prog_link </td>
</tr>
</tbody>";
}
?>
</table>
</div><!--end of allresults div-->
</div>
<footer>
© Mark Bestford 2012. All rights reserved.
</footer>
as you can see it prints out the user ID as I hold that not the user name the tables im using are lr_programme and the user data is held on a table called users
any help would be great thanks and regards
Bestford

New Topic/Question
Reply


MultiQuote





|