Fork me on GitHub

*SOLVED* number of rows from a result set?  Bottom

  • Code

    $chkYr=getdate();
        $sqlChk="SELECT * FROM cpg132_catagories WHERE name='".$chkYr['year']." Summer Camps'";
        $sqlChk2=$dbconn->Execute($sqlChk);
        $row=mysql_fetch_assoc($sqlChk2);
       
        if (mysql_num_rows($sqlChk2) == 1) {
            die('it worked');
        }


    I am trying to check if the number of rows that a result set came back with. this way is not working for me. is there a better quicker way to determine how many rows a result set comes up with?

    thanks
  • if you have to use the data (rather than just wanting the nubmber), you could count() the result array after processing.

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • I used the RecordCount() method. I posted this and then came accross the document with all the functions on it. quite helpful.

    if anyone else needs it. a good version is located here:

    http://phplens.com/lens/adodb/docs-adodb.htm#recordcount

This list is based on users active over the last 60 minutes.