P2P | IT Discussions Forum

Full Version: script help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey,

I am new to PHP and am trying to create a page that is basically a directory that calls information from the mysql database.

this is my function
PHP Code:
function review($letter){
$result = mysql_query("SELECT * FROM reviews WHERE name LIKE '".$letter."%' ORDER BY name", $connection);

for ($i = 0; $i < mysql_num_rows($result); $i++)
{
$name = mysql_result($result, $i, "name");

echo "<a href="/reviews/".$name.".php">".$name."</a>
";
}
}

when I say review("A"), it should call the information from the reviews database and create a link for all the names that start with the letter A.
I do not know why it is not working, I am pretty sure it has someting to do with the query but can not pinpoint it. Any help is greatly appreciated.

Thanks.
Reference URL's