PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
franknu
Forum Contributor
Posts: 146 Joined: Sun May 28, 2006 9:29 am
Post
by franknu » Wed Mar 28, 2007 11:49 am
i need some
Code: Select all
if(isset($_POST['submit']))
{
$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}', `Keyword`='{$Keyword}', `Picture1`='{$Picture1}',
`Headline`='{$Headline}', `Slogan2`='{$Slogan2}', `Description1`='{$Description1}',
`Description2`='{$Description2}', `Description3`= '{$Description3}',
`Picture2`='{$Picture2}', `Picture3`='{$Picture3}',
`Password`='{$Password}' WHERE `User_Name`='{$User_Name}'";
$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"<td>";
echo"Business Info";
echo"</td>";
echo"</tr>";
echo"<tr>";
echo"<td>";
echo"<table>";
echo"<tr>";
echo"<td>";
echo"Business Name";
echo"</td>";
echo"<td>
<input type='text' name='BusinessName' Value='$BusinessName'>";
echo" </td>";
echo"</tr>";
echo"<tr>";
echo"<td>";
echo"Slogan";
echo"</td>";
echo"<td>
<input type='text' NAME='Slogan' value='$Slogan'>";
echo" </td>";
echo"<td>";
echo"Website";
echo"</td>";
echo"<td> <input type='text' name='Website' value='$Website'>";
echo"</td>";
echo"</tr>";
echo"<tr>";
echo"<td>";
echo"Tel";
echo"</td>";
echo"<td>
<input type='text' name='Tel' value='$Tel'>";
i added this line...
Code: Select all
<input type='text' name='BusinessName' Value='$_POST['BusinessName'],'>";
bu then i got a syntax error on this line any help please
RobertGonzalez
Site Administrator
Posts: 14293 Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA
Post
by RobertGonzalez » Wed Mar 28, 2007 11:54 am
The line you added isn;t quoted properly.
franknu
Forum Contributor
Posts: 146 Joined: Sun May 28, 2006 9:29 am
Post
by franknu » Wed Mar 28, 2007 11:57 am
what is the right quatation for those
thank you..
RobertGonzalez
Site Administrator
Posts: 14293 Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA
Post
by RobertGonzalez » Wed Mar 28, 2007 12:02 pm
You might want to consider something like this...
Code: Select all
<?php
if (isset($_POST['submit']))
{
$sql = "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', `Keyword`='$Keyword', `Picture1`='$Picture1',
`Headline`='$Headline', `Slogan2`='$Slogan2', `Description1`='$Description1',
`Description2`='$Description2', `Description3`= '$Description3',
`Picture2`='$Picture2', `Picture3`='$Picture3',
`Password`='$Password' WHERE `User_Name`='$User_Name'";
$result = mysql_query($sql) or die (mysql_error());
}
?>
<table bgcolor='ffffff'>
<tr>
<td>
<table>
<tr>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td>
<table>
<tr>
<td>
<table bgcolor='ffffff '>
<tr>
<td>
<table>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method='Post'>
<tr>
<td>
Business Info
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td>
Business Name
</td>
<td>
<input type='text' name='BusinessName' Value='<?php echo $BusinessName; ?>'>
</td>
</tr>
<tr>
<td>
Slogan
</td>
<td>
<input type='text' NAME='Slogan' value='<?php echo $Slogan; ?>'>
</td>
<td>
Website
</td>
<td>
<input type='text' name='Website' value='<?php echo $Website; ?>'>
</td>
</tr>
<tr>
<td>
Tel
</td>
<td>
<input type='text' name='Tel' value='<?php echo $Tel; ?>'>
franknu
Forum Contributor
Posts: 146 Joined: Sun May 28, 2006 9:29 am
Post
by franknu » Wed Mar 28, 2007 12:09 pm
i am sorry, but i dont see the diffrents, i dont want to be a jackass but i also want to learn can you explain please
RobertGonzalez
Site Administrator
Posts: 14293 Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA
Post
by RobertGonzalez » Wed Mar 28, 2007 12:32 pm
There is not a whole lot of difference other than the cleanliness of the code. I guess what I would like to know is what is not working that you need help with? You said earlier that you got a parse error. Well, if you limit the amount of parsing to do (which is what I did) your chance for errors goes way down. Have you run the code I posted yet?