Monday, 29 February 2016

HOw to Update Join Query in Mysql

Query
 ======
 $sql="Update sub_category as  sub,category as cat SET sub.sub_name='$itemname',sub.sub_description='$txtitemdesc',sub.stock_day='$txtstockday',cat.category_description='$txtcatdesc',cat.category_name='$txtcatname' where sub.category_id=cat.cat_id and sub.subcat_id='$idget'";

 Example
 ========
 Update sub_category as sub,category as cat SET sub.sub_name='poteto1',sub.sub_description='This is poteto1',sub.stock_day='71',cat.category_description='In everyday usage, a vegetable is any part of a plant that is consumed by humans as food as part of a savory meal.1',cat.category_name='Vegetables1' where sub.category_id=cat.cat_id and sub.subcat_id='5'

No comments:

Post a Comment