Re: Select record by ID
| From: | Paul Novitski | Date: | Sun, 28 Jan 2007 23:54:06 +0000 |
| Subject: | Re: Select record by ID | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247921@lists.php.net to get a copy of this message | ||
At 1/28/2007 03:21 PM, nitrox . wrote:
Im trying to display one record at a time by ID. Well im getting a blank page. Ive looked over my code and tried 20 different ways to get it to work to no avail. So any pointers on what Im doing wrong would be great. here is the code im working with so far.
<?php
include("db.php");
$result = mysql_query("SELECT * FROM inf_member WHERE user_id='$user_id' ");
while($myrow = mysql_fetch_assoc($result))
{
echo "<b>";
echo $myrow['user_name'];
...
My off-hand guess is that your user_id might be a numeric value (auto-increment?) and that putting it in quotes makes for an invalid query.
What is the value of $result? If $result === false then display mysql_error() to diagnose the problem.
Regards,
Paul
__________________________
Juniper Webcraft Ltd.
http://juniperwebcraft.com