PHP/MySQL oddity

GEC: Discuss gaming, computers and electronics and venture into the bizarre world of STGODs.

Moderator: Thanas

Locked
User avatar
Spyder
Sith Marauder
Posts: 4465
Joined: 2002-09-03 03:23am
Location: Wellington, New Zealand
Contact:

PHP/MySQL oddity

Post 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>
?
:D
User avatar
Spyder
Sith Marauder
Posts: 4465
Joined: 2002-09-03 03:23am
Location: Wellington, New Zealand
Contact:

Post 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...
:D
Locked