Writing functions in php for inserting data in mysql using php
$car_class="bmw";
$description="nice car";
$car_class and $description are the variable which are being passed to function for inserting data in database.
insert_class_car($car_class,$description);
insert_class_car($car_class,$description);
above syntax is calling function,
function insert_class_car($car_class,$description)
{
$car_class_1=$car_class;
$description_1=$description;
$query=mysql_query("Insert Into car_class(id,class_name,description,is_del)values('','$car_class_1','$description_1','approved')") or die(mysql_error());
}
above syntax is body of fucnction.
No comments:
Post a Comment