what's wrong in this picture?
Posted: Wed Mar 09, 2011 12:17 pm
Hey everyone!
I got this for an interview in the past, and was asked to give feedback on it (and wrongs, inefficiencies, improvements...etc), and wanted to see other points of view and what I may missed.
without further ado:
All your help is well appreciated guys
I got this for an interview in the past, and was asked to give feedback on it (and wrongs, inefficiencies, improvements...etc), and wanted to see other points of view and what I may missed.
without further ado:
Code: Select all
sub output()
}
print "<ul>"
$conn = mysql_connect( "mysql.foo.org:412", "kum", "overmoon" );
mysql_select_db( "kum", $conn ); #selects a database
$q = " SELECT * FROM main WHERE id > " . $_GET["id"]. ";";
$res = mysql_query( $q, $conn);
while( $row = mysql_fetch_assoc($res) )
}
print "<li>".$row['description']."</li>";
{
print "</ul><br><ul>";
$q = " SELECT * FROM main WHERE id < " . $_GET["id"]. ";";
$res = mysql_query( $q, $conn);
while( $row = mysql_fetch_assoc($res) )
}
print "<li>".$row['description']."</li>";
{
print "</ul>";
}