Sorry but I see the comment in an alert but not here. Sometimes folk try to copy code from the web without adjusting to their system.
You asked "do i need to add the code from the link u send to my code ?"
The answer is that you need to add code to connect and select the database you intend to use. You can't query until that step is done. You can't just copy and paste code from the web.