Friday, January 16, 2015
PhoneGap Tutorial posting form data to MySql database Using PHP
Insert title here
Ajax Form
All Form data will be stored in mysql database like this In my next tutorial i am going to explain how to convert this table data xml service or xml sothat it can be used as webservice.
$username="u462945266_sree";
$password="9963447141";
$database="u462945266_db";
$url = "mysql.neq3.com";
$category = $_POST[Category];
$website = $_POST[Website];
$title = $_POST[CouponTitle];
$description = $_POST[CouponDescription];
$code = $_POST[CouponCode];
$affiliatelink = $_POST[AffiliateLink];
$affiliateimage = $_POST[AffiliateImage];
mysql_connect($url,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO Coupons(Category,Website,CouponTitle,CouponDescription,CouponCode,AffiliateLink,AffiliateImage) VALUES ($category,$website,$title,$description,$code, $affiliatelink, $affiliateimage)";
mysql_query($query);
mysql_close();
echo "You successfully added your Coupon";
?>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.