[thelist] php/mysql help

Shashank Tripathi sub at shanx.com
Wed Feb 20 00:33:01 CST 2002


Hi

    >> *But it does work* and gets Sarah the desired results.

Deja vu!
:)


    >> However, I would like to know a "cleaner" solution.


The code in my email would also work, with just one DB trip. Checking is
done in PHP.


    >> I was foxed with the following line in your code (or am I just losing
it!)


As I perhaps mentioned in my note, it is "pseudocode" (logic only, without
the syntax of any particular language) although I intentionally made it to
look like PHP. Replace $tempDate with whatever the date format from the SQL
is, and $resultSet is the record set (an array) returned when the SQL is
executed. The subscript "i" refers to each row, and 0 signifies the first
column (as my comment before that line suggested). So "$resultSet[$i][0]"
refers to the date column from each row...

Your idea to store count() in a variable prior to the loop is a great one!
Should definitely be implemented in real code..

Cheers
Shanx






More information about the thelist mailing list