Forum Moderators: open
Can somebody help me pls?
Thnx in advance
So if you search 'smith' it would show. John, jane, harry. You pick the one that you want, and if you don't find one matching. Then you can give them the option to create a new record.
Does this sovle what you are asking? If not post your questiona gain and I will try to help.
What you need though is 3 basic SQL statements.
1 select
1 update
1 insert
This is roughly what they will look like in SQL although you will ahve to PHP-ify this.
*****select*****
<incoming param>last_name</incoming param>
select
*
from
customer_table c
where
lower(c.last_name) like 'last_name%';
**********************
*****update*****
<incoming param>unique_customer_id, first_name, last_name, and_so_on</incoming param>
update customer_table set
if last_name:
last_name = last_name,
if first_name:
first_name = first_name
if and_so_on:
and_so_on = and_so_on
where
unique_customer_id = unique_customer_id;
**********************
*****insert*****
<incoming param>new_unique_customer_id, first_name, last_name, and_so_on</incoming param>
insert into customer_table(
unique_customer_id,
last_name,
first_name,
and_so_on
)values(
new_unique_customer_id,
last_name,
first_name,
and_so_on
);
**********************
Good Luck and if you need any SQL systax you can sticky me or post back here.
$result=mysql_query("select fname,lname,lcnumber from input where fname='$Name' and lname='$Sname' and lcnumber='$Plates'" );
$row = mysql_fetch_row($result);
if ($row<1)
{
echo "The customer does not exists";
}
else
{
continue in the form to add the data
}
The program makes the search and give the fail result if the customer does not exist in the if.
as else i add the page which the owner goes to update his customer..