Welcome! Log In Create A New Profile

Advanced

Database return

Posted by WPJones123 
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
Database return
February 14, 2012 11:24AM
Hi,

When i register a user let say with the standard ID number 7610015060089, and try to read it back i get a different number. Any ideas??

Here is the code i am using to read from my database

<?php
error_reporting(0);
session_start();
if ($_SESSION['username'])
{
include('connect.php'winking smiley; // connet to databae

$query = "SELECT * FROM USER ORDER BY user_id"; // read data from user table and sort by user_id
$result = mysql_query($query)

or die("Query failed: " . mysql_error()); //Check if connectin has been made and that database ex

echo "<table border ='1'>";
echo "<tr>";
echo "<th>Title</th><th>User ID</th><th>Name </th><th>Surname </th><th>User name </th><th>Action </th>";
echo "</tr>";

while ($row = mysql_fetch_array($result))
{
$user_id=$row['user_id'];
echo "<tr>";
echo "<td>", $row['title'],"<td>", $row['user_id'],"</td>","<td>",$row['name'],"</td>","<td>",$row['surname'],"</td>","<td>",$row['username'],"</td>","<td>","<a href=delete_user.php?user_id=$user_id&delete=yes>Delete</a>";
echo "</tr>";
}
}
else
die("You need to be logged in"winking smiley;
?>
avatar
Mac
Re: Database return
February 15, 2012 08:46AM
This is the 2011 forums. Also make use of formatted code button to include code in a post.
Re: Database return
February 15, 2012 10:21AM
Is there a new forum then for 2012?
Sorry, only registered users may post in this forum.

Click here to login