Turning on display_errors while you are testing will make it much easier to find and fix the errors.
You would of course remove that line after you finish testing.
Since the call returns false if it can’t assign a resource you don’t really need to check specifically that it is a resource (although doing so can help to reduce the possibility of errors). Simply not having the field evaluate to false is sufficient to indicate that it contais a resource given that the preceding statement will assign either a resource or false.
That means that the query is now working since it returns the resource that provides the link to the database (which is what all sql query calls return if they successfully connect to the database).
To be able to see the value(s) returned by the query you need to actually fetch the rows returned and extract the fields that those rows contain.
Thanks for you all, I appreciate your help.
AnthonySterling your code is working properly, but I like to understand it please, why you use ( ini_set ) and ( is_resource ) in your code ? I mean what is their roles exactly ?