Re: Select record by ID

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

 



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

--
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