Hi everyone, i'm having problem on what PHP code that is appropriate for me to search for a specific data from mysql database, help me with how to go about please
Here's what I do to prototype such a search. I usually have an example output (report) that I am attempting to achieve. Then I manually craft a SQL command using the command line that gives me the dataset I need for the report.
After that, that SQL command is re-used in the PHP to create the desired output.
I'm finding folk I am running into today are heading straight to code rather than sketching out what they want, building the SQL command line and sometimes skipping the design stage. What happens is they often feel lost.
Also, remember there are two MySQL api's for PHP. One is the mysql api (deprecated and no longer supported), and the newer mysqli api which is the currently supported one. You will find documentation for them on the PHP web site documentation pages.
PDO also deserves a mention, when talking about different MySQL APIs. It's not exclusively for MySQL, but the support for it is superp. In fact, it has some features MySQLi does not. (Like named parameters.)
And, as an added bonus, if/when you ever start using other databases, you don't have to learn a new API; PDO supports all the popular databases.