Hi,
I'm having some problem with the following code, is searches and returns the requested data but for some reason never displays the first result, so if there is only one result for the usr_Login it wont return any results.
<?php
$username = "root";
$password = "";
$hostname = "localhost";
$dbconn = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL");
$database = mysql_select_db("enet",$dbconn);
// assumes structure of table; and
// that this page is accessed from a form on another page - that form uses POST and has a field cCode
$query = "SELECT sho_Name, sho_Path FROM Query1 WHERE usr_Login = '" . $_POST["usr_Login"] . "'";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
while ($row=mysql_fetch_array($result)) {
$link = '<a href=""' . $row['sho_Path'] . '">' .$row['sho_Path'] . '</a>';
echo '<tr><td>' . $row["sho_Name"] . '</td></tr>'; echo '<tr><td>'.$link.'</td></tr>';
}
mysql_close($dbconn);
?>
Does anyone have any idea why this is happening?