Page 1 of 1

PHP/MySQL oddity

Posted: 2005-06-17 02:58am
by Spyder
Can anyone tell me why this code:

Code: Select all

<html>
<head>
<title>Oi!</title>
</head>
<body>

<?
$conn = mysql_connect("localhost", "root", "*****");
mysql_select_db("lanman", $conn);
$result = mysql_query("select id, name from test, $conn);
list($id, $name) = mysql_fetch_row($result);
?>




<center>
 <p>Hello <? echo $name; ?>!<br>
 Your id is <? echo $id; ?>
</center>
<?
// mysql_free_result($result);
?>
</body>
</html>
Produces this:

Code: Select all

<html><body></body></html>
?

Posted: 2005-06-17 05:28am
by Spyder
Hey guess what. I WAS MISSING A PAIR OF QUOTES!

Don't worry mods, I'll just show myself out.

Image

At least it would be if I could lock threads...