Code:
<?php $mysqlconnect = @mysql_connect('localhost', 'root', 'baz');
$dbconnect = @mysql_select_db('database');
$name = $_GET['n'];
$result = @mysql_query('SELECT * FROM foobar WHERE (name = $name)');
$row = mysql_fetch_array($result);
?>
Should read:
Code:
<?php
$mysqlconnect = mysql_connect("localhost", "root", "baz");
$db = mysql_select_db("database");
$name = $_GET['n'];
$result = mysql_query("SELECT * FROM foobar WHERE name='$name'");
$row = mysql_fetch_array($result);
?>
note, WHERE clause variables need to be quoted, I use " quotes in php code/functions, and ' for sql queries, thats just me though.. this *should* work, keep it up.
the @ just suppresses function warnings/errors, might want to keep them out for learning, so if you bugger something up it'll help explain what went wrong.