Jump to content

How to return a page when data is not found in a table?


kisazeky

Recommended Posts

Hi there, I've recently implemented a profile system on my site that, when given a valid username, will get his/her information from the user table and display it.

 

But, how can I make it return a page "User not found!"  if, well, the user can't be found.

 

Thanks.  ;D

 

My query looks like this:

 

$query = "SELECT * FROM owned_adoptables WHERE owner = '$owner' ORDER BY uid DESC LIMIT 0,5 ";
$result = mysql_query($query);
$num = mysql_numrows($result);

//Loop out code
$i=0;
while ($i < $num) {

$id=@mysql_result($result,$i,"uid");
$name=@mysql_result($result,$i,"name");
$imageurl=@mysql_result($result,$i,"imageurl");

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.