11-24-2008, 03:06 AM
|
#1 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
|
Help with my function.
hey, well here is my script
PHP Code:
function readUsers() { $sql = sprintf(" SELECT * FROM `crud_` WHERE `id` = '%s'", mysql_real_escape_string($id)); $res = @mysql_query($sql) or die(mysql_error()); if ($res) { $output = ''; while ($row = mysql_fetch_array($res, MYSQL_ASSOC)) { $output .= "First Name :{$row['fname']} <br>" . "username :{$row['uname']} <br>" . "email : :{$row['email']} <br>" . "phone :{$row['phone']} <br>"; } return $output; }else{ return false; } }
and then on a page called showusers i have like this
PHP Code:
<?php include "crud_functions.php"; connect();
//list users $listUsers = readUsers(); echo $listUsers;
?>
but the showusers page turns blank..
why ?
Thank you in advance.
.Codefreek
Last edited by codefreek : 11-24-2008 at 06:03 AM.
|
|
|
|