hi i need a help updating database
here is my code
[code=php]
$db = mysql_connect($host, $username, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
$User_Name=strtolower($_POST[‘User_Name’]);
$Password=strtolower($_POST[‘Password’]);
$usercheck = mysql_query(“SELECT * FROM business_info where
User_Name=’$User_Name’ AND Password=’$Password'”,$db);
$userrow = mysql_fetch_array($usercheck);
$num_rows = mysql_num_rows($usercheck);
$query = “SELECT * FROM business_info where User_Name=’$User_Name’ AND Password=’$Password'”;
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
$Categories=$row[‘Categories’];
$Business_Address= $row[‘Business_Address’];
$make=$row[‘make’];
$type=$row[‘type’];
$Tel= $row[‘Tel’];
$Website=$row[‘Website’];
}
if ($num_rows!=1)
{
print “<p><b>username and/or password not found. Try
again?</b></p>”;
}
else
{
echo”<table border=’0′>”;
echo” <tr>”;
echo “Welcome to the The member session<br>
here you can update your webpage<br>”;
//start here
$query = “SELECT * FROM business_info WHERE `BusinessName`= ‘$BusinessName’
AND `User_Name`=’$User_Name'”;
$result = mysql_query($query) or die (mysql_error());
$res2 = mysql_fetch_assoc($result);
echo “$BusinessName”;
if(isset($_GET[‘update’]))
{
$query=”UPDATE business_info SET `BusinessName`= ‘$BusinessName’, `Slogan`='{$Slogan}’,
`Business_Address`='{$Business_Address}’, `Tel`='{$Tel}’, `Website`=’$Website’,
`Email`='{$Email}’, `Fax`='{$Fax}’, `type`='{$type}’,
`make`='{$make}’, `Categories`='{$Categories}’,
$result = mysql_query($query) or die (mysql_error());
}
echo”<table bgcolor=’ffffff’>”;
echo”<tr>”;
echo”<td>”;
echo”<table>”;
echo”<tr>”;
echo”</tr>”;
echo”</table>”;
echo”</td>”;
echo”</tr>”;
echo”<tr>”;
echo”<td></td>”;
echo”</tr>”;
echo”<tr>”;
echo”<td>”;
echo”<table> “;
echo” <tr>”;
echo”<td>”;
echo”<table bgcolor=’ffffff ‘>”;
echo” <tr>”;
echo”<td>”;
echo”<table>”;
echo”<form action=”{$_SERVER[‘PHP_SELF’]}” method=’Post’>”;
echo”<tr>”;
echo”<tr>”;
echo” <td> <input type=’text’ name=’Headline’ value=’$Headline’>”;
echo” </td>”;
echo”<tr>”;
echo”<td> <input type=’text’ name=’Slogan2′ value=’$Slogan2′>”;
echo”</td>”;
echo” </tr>”;
echo”<tr>”;
echo” <td>”;
echo”Description1″;
echo” </td>”;
echo”</tr>”;
echo”<tr>”;
echo”<td>”;
echo”<TEXTAREA ROWS=5 COLS=65 NAME=’Description1′ value=’$Description1′>$Description1 </TEXTAREA> “;
echo”<td>”;
echo”Description3″;
echo”</td>”;
echo”</tr>”;
echo”<tr>”;
echo”<td><TEXTAREA ROWS=5 COLS=65 NAME=’Description3′ value=’$Description3′>$Description3</TEXTAREA>”;
echo”</td>”;
echo”</tr>”;
echo” <tr>”;
echo” <td>”;
echo”<table>”;
echo”<tr>”;
echo”<td>”;
echo”User Name”;
echo”</td>”;
echo”<td> <input type=’text’ name=’User_Name’ value=’$User_Name’>”;
echo”</td>”;
echo”<td>”;
echo”Password”;
echo”</td>”;
echo”<td> <input type=’text’ name=’Password’ value=’$Password’>”;
echo”</td>”;
echo”</tr>”;
echo”</table>”;
echo”</td>”;
echo”</tr>”;
echo”</table>”;
echo” </td>”;
echo”</tr>”;
echo”<tr>”;
echo”<td>
<input type=’submit’ value=’Update my database’ name=’update’ />
<input type=’reset’ value=’Reset fields’ />”;
echo”<td> “;
echo”</form>”;
echo”</table>”;
echo”</td>”;
echo”<td>”;
echo”</td>”;
echo” </tr>”;
echo”</table>”;
echo”</td>”;
echo”</table> ” ;
echo” </tr>”;
//finish here
echo “<td> </td>”;
echo”</td>”;
echo”<td valign=’top’>”;
echo”</td>”;
echo”</tr>”;
echo”</table>”;
echo”</td>”;
echo”</tr>”;
echo”</table>”;
}
?>
</body>
</html>
i dont know why i cant update it, when i hit the update botom just take me back to what was there already