Re: Select record by ID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux