SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Threaded View
-
Sep 24, 2000, 14:29 #1
- Join Date
- Jul 2000
- Posts
- 88
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi everyone:
I can't input any information with an apostrophe (Bob's Bar) into mySQL. I am using a php3 template to input data into my database. Any advice or code I need to insert into my php page?
<?php
if ($submit): // A new business has been listed
// using the form below.
$dbcnx = @mysql_connect(
"localhost", "XXXXXX", "XXXXXXXX");
mysql_select_db("XXXXXX");
$sql = "INSERT INTO Business SET " .
"Business_Name='$businessname', " .
"Category='$category', " .
"Subcategory='$subcategory', " .
"Neighborhood='$neighborhood', " .
"Business_Description='$businessdescription', " .
"Address_1='$address1', " .
"Address_2='$address2', " .
"City='$city', " .
"State='$state', " .
"Zipcode='$zipcode', ".
"Phone_Number='$phonenumber', " .
"E_Mail='$email', " .
"Web_Site='$website', " .
"Contact_Name='$contactname', " .
"Date=CURDATE(),".
"Visible='N',".
"Expiration_Date=ADDDATE(CURDATE(), INTERVAL 6 MONTH)";
if (mysql_query($sql)) {
echo("<p>Thank you for adding your business listing to our directory.</P>");
} else {
echo("<P>Error Adding New Business Listing: " .
mysql_error() . "</P>");
}
?>
<?php
else: // Allow The User To Enter A New Business Listing
?>
Bookmarks