Hi ,
> will your suggestion protect my db if I have two
> customers with the same name?
Yes , it would with the consideration that the sequence used to create
the cust_id is increasing by some number , customer may have same
name but in all means the customer name which is having the MAXIMUM
cust_id is ur need.
> does it always return
> the highest cust_id and is that *always* the last
> cust_id entered?
>
did i said I gave you a query that would run faster you may alternatively use
$id = "SELECT max(cust_id) from customer where customer_name ='$cust' " ;
Use explain in psql and u will know why I suggested the previous query.
--
With Best Regards,
Vishal Kashyap.
Lead Software Developer,
http://saihertz.com,
http://vishalkashyap.tk