0

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

4
Contributors
3
Replies
29
Views
1 Year
Discussion Span
Last Post by Atli
3

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.

Votes + Comments
+1
2

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.

Votes + Comments
+1 for noting that.
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.