once i submit the info it just clear the value box which delete everything in that field in the database
here is my code
Code: Select all
$sql = "SELECT * FROM business_info WHERE BusinessName = '$BusinessName' AND User_Name = '$User_Name'";
$result = mysql_query($query) or die ("Problem with the query: <pre>$sql</pre><br>" . mysql_error());
$res2 = mysql_fetch_assoc($result);
if(isset($_POST["submit"]))
{
$query="UPDATE business_info SET BusinessName= ('$_POST[BusinessName]'), `Slogan`=('$_POST[$Slogan]'),
Business_Address = ('$_POST[Business_Address]'), Tel=('$_POST[Tel]'), Website= ('$_POST[Website]'),
Email = ('$_POST[Email]'), Fax= ('$_POST[Fax]'), `type`='$type',
make = '$make', Categories = ('$_POST[Categories]'), Keyword = ('$_POST[Keyword]'), Picture1 = ('$_POST[Picture1]'),
Headline = ('$_POST[Headline]'), Slogan2 = ('$_POST[Slogan2]'), Description1 = ('$_POST[Description1]'),
Description2 = ('$POST[Description2]'), Description3 = ('$_POST[Description3]'),
Picture2 = ('$_POST[Picture2]'), Picture3 = ('$_POST[Picture3]'),
`Password`= '$Password' WHERE User_Name = '$User_Name'";
$result = mysql_query($query) or die ("Problem with the query: <pre>$query</pre><br>" . mysql_error());
}
echo"<table bgcolor='ffffff'>";
echo"<tr><td> <table><tr> </tr> </table> </td></tr><tr><td></td>
</tr><tr><td> <table> <tr> <td><table bgcolor='ffffff'>
<tr> <td>
<table> ";
//208
echo '<form action="'. $_SERVER['PHP_SELF'].'" method="post"enctype="multipart/form-data">';
echo"<tr>";
echo"<td> Busiess Info </td></tr><tr>
<td>
<table>
<tr>
<td>
Business Name
</td>
<td>";
echo"<input type='text' name='BusinessName' Value=('$_POST[BusinessName]'> </td>
</tr> <tr> <td> Slogan </td> <td>";
echo"<input type='text' NAME='Slogan' value=('$_POST[Slogan]'>";
echo"</td> <td> Website </td> <td> <input type='text' name='Website' value='$Website'> </td>";
echo"</tr>
<tr>
<td>
Tel
</td>
<td>";
echo"<input type='text' name='Tel' value='$Tel'>";
echo"</td>";
echo"<td>
Key Words
</td>
<td>";
echo"<input type='text' name='Keyword' value='$Keyword'>";
echo"</td>
</tr>
<tr>
<td>
Fax
</td>
<td>";
echo"<input type='text' name='Fax' value='$fax'>";
echo"</td>
<td>
Address
</td>
<td>";
echo" <input type='text' name='Business_Address' value='$Business_Address'>";
echo"</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table>
<tr> <td> </td> <td>
</td> <td></td><td> </td><td>
Category
</td>
<td>";
echo '<textarea ROWS=5 COLS=65 NAME="Categories">' . $_POST['Catagories'] . '</textarea>';
echo" </td>
</tr>
</table>
<table>
<tr>
<td>
Business Webpage
</td>
</tr>
<tr>
<td>
Headline
</td>
</tr>
<tr>
<td>";
echo" <input type='text' name='Headline' value=('$_POST[Headline]')>";
echo" </td>";
echo" </tr>";
echo"<tr>";
echo" <td>";
echo"Slogan";
echo"</td>";
echo"</tr>";
echo"<tr>";
echo"<td> <input type='text' name='Slogan2' value=('$_POST[Slogan2]')>"
;
echo" </td>
</tr>
<tr>
<td> Description </td>
</tr>
<tr>
<td>";
echo" <TEXTAREA ROWS=5 COLS=65 NAME='Description1' value=('$_POST[Description1]')>$Description1 </TEXTAREA> ";
echo"</td>
</tr>
<tr>
<td>
Description2
</td>
</tr>
<tr>
<td>";
echo"<TEXTAREA ROWS=5 COLS=65 NAME='Description2' value='$Description2'>$Description2</TEXTAREA>";
echo"</td>
</tr>
<tr>
<td>
Description3
</td>
</tr>
<tr>
<td>";
echo"<TEXTAREA ROWS=5 COLS=65 NAME='Description3' value='$Description3'>$Description3</TEXTAREA>";
echo"</td>
</tr>
<tr>
<td>
<table>";
echo"<table>";
echo"<tr>
<td>";
echo" Picture1";
echo" <input name='Picture1' type='file' value=''></td>
<td> <img src='dfdfd.jpg'></td>";
echo"</tr>";
echo"<tr>
<td>";
echo" Picture2";
echo" <input name='Picture2' type='file' value=''></td>
<td> <img src='dfdfd.jpg'></td>";
echo"</tr>";
echo"<tr>
<td>";
echo" Picture3";
echo" <input name='Picture3' type='file' value=''></td>
<td> <img src='dfdfd.jpg'></td>";
echo"</tr>";
echo"<tr>
<td>";
echo" Picture4";
echo" <input name='Picture4' type='file' value=''></td>
<td> <img src='dfdfd.jpg'></td>";
echo"</tr>";
echo"<tr>
<td>";
echo" Picture5";
echo" <input name='Picture5' type='file' value=''></td>
<td> <img src='dfdfd.jpg'></td>";
echo"</tr>";
echo"<tr>
<td>";
echo" Picture6";
echo" <input name='Picture6' type='file' value=''></td>
<td> <img src='dfdfd.jpg'></td>";
echo"</tr>";
echo"<tr>
<td>";
echo" Video";
echo" <input name='video' type='file' value=''></td>
<td> <img src='dfdfd.jpg'></td>";
echo"</tr>";
echo"<tr>
<td>";
echo"Sound";
echo" <input name='sound' type='file' value=''></td>
<td> <img src='dfdfd.jpg'></td>";