Re: Select record by ID

From: Date: Sun, 28 Jan 2007 23:51:08 +0000
Subject: Re: Select record by ID
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-247919@lists.php.net to get a copy of this message
I took the quotes off. I thought that quotes around numbers was wrong also. I added the error checking and this is the error: Could not perform query : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 and this is the code again: <?php include("db.php");
       $result = mysql_query("SELECT * FROM inf_member WHERE user_id=$user_id");
       if ( ! $result ) {
die ("Could not perform query $query: ".mysql_error()."\n"); } while($myrow = mysql_fetch_assoc($result))
             {
                    echo "<b>";
                    echo $myrow['user_name'];
                    echo "</b>";
                    echo $myrow['rank'];
echo "</b>";
                    echo $myrow['country'];
echo "</b>";
                    echo $myrow['email'];
                    echo "</b>";
                    echo $myrow['quote'];
                    echo "</b>";
                    echo $myrow['config'];
echo "</b>"; echo $myrow['map'];
                    echo "</b>";
                    echo $myrow['gun'];
                    echo "</b>";
                    echo $myrow['brand'];
echo "</b>"; echo $myrow['cpu']; echo "</b>";
                    echo $myrow['ram'];
                    echo "</b>";
                    echo $myrow['video'];
                    echo "</b>";
                    echo $myrow['sound'];
echo "</b>"; echo $myrow['monitor'];
                    echo "</b>";
                    echo $myrow['mouse'];
                    echo "</b>";
                    echo $myrow['brand'];
echo "</b>";
            }
?> _________________________________________________________________ Laugh, share and connect with Windows Live Messenger http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/?href=http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=hmtagline

« previous php.general (#247919) next »