Hi

I am new to php.

How to implement credit card payment for a site (no 3rd party tool) and how insert them in database?

validations for credit card numbers and check 3 digit number of the card.

Thanks

You cannot do payments without a 3rd party tool, unless you (or your company) are a bank certified payment provider.

Basic validations can be found all over the net.

Choose one and read the API documentation. PayPal for example, check out their website. Be sure to select one that meets your needs.

If you're new to php, it's probably going to be tough.
last time i checked you needed a paid paypal account in order for the API to even be accessible for you.
If you still want to push through, prepare to spend a lot of time in the api documents, and try to youtube up some tutorials