Start with PHP; syntax, functions and the move onto database interactions at a later stage. Take a look at php.net, all the functions / syntax are describe there
First, solve the problem. Then, write the code.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
When asking for assistance give as much information about the problem as possible