Hi

all

I have created a procedure in my sql to update the table records. the code is

CREATE PROCEDURE `update_booking_details`(in p_s_no int,in p_contact_name varchar(35),in p_phno bigint, in p_email varchar

(45),in p_vehicle varchar(35),in p_package varchar(45),in p_reqdate date,in p_time1 varchar(25),in p_passangers int,in p_pickup_addr varchar(45),in p_landmark varchar(35),in p_drop_addr varchar(45),in p_landmark1 varchar(35),in p_booking_id

varchar(35),in p_smstext varchar(100),in p_remarks varchar(100),in p_created_by varchar(35),p_created_on DATE,in p_updated_by varchar(35),p_updated_on DATETIME)
begin
update booking_details
SET
s_no=p_s_no,contact_name=p_contact_name,email = p_email,vehicle =p_vehicle, package =p_package, reqdate =p_reqdate,time1=p_time1, passangers =p_passangers ,pickup_addr =p_pickup_addr ,landmark =p_landmark ,drop_addr =p_drop_addr ,landmark1=p_landmark1 ,smstext =p_smstext ,remarks=p_remarks,created_by=p_created_by,created_on=p_created_on,updated_by=p_updated_by, updated_on=p_updated_on
where booking_id=p_booking_id OR phno=p_phno;

I am calling this procedure in php file

include("config.php");
if ($mysqli->multi_query("CALL update_booking_details ('$_POST[s_no]','$_POST[contact_name]','$_POST[phno]','$_POST[email]','$_POST[vehicle]','$_POST[package]','$_POST[reqdate]','$_POST[time1]','$_POST[passangers]','$_POST[pickup_addr]','$_POST[landmark]','$_POST[drop_addr]','$_POST[landmark1]','$_POST[booking_id]','$_POST[smstext]','$_POST[remarks]','$_POST[created_by]','$_POST[created_on]','$_POST[updated_by]','$_POST[updated_on]');")) {
do {
/* store first result set */
if ($result = $mysqli->store_result()) {
while ($row = $result->fetch_row()) {
printf("%s\n", $row[0]);
}
$result->close();
}
/* print divider */
if ($mysqli->more_results()) {
printf("-----------------\n");
}
} while ($mysqli->next_result());

I am using the php form which is having the search field when user enters the phno in the search field if it finds the data it will populate all the form fields.
Now user will modify the changes required in the form and clicks on the update button. Instead updating the existing record, it is creating new record.
But i dont want to create new records i want to update the old record with new changes