Just a dumb question: if you want to get active scripts why is the condition WHERE active = '0'? Shouldn't it be WHERE active != '0'?
broj1
Nearly a Posting Virtuoso
1,211 posts since Jan 2011
Reputation Points: 167
Solved Threads: 164
Skill Endorsements: 13
Or put a counter within a while loop and see how many rows you get (you might use PDO's number of rows function):
public function headLoad()
{
// debug ceounter
$i = 0;
$cxn = $this->connection()->prepare("SELECT scriptCode FROM head_scrips WHERE active = '0'");
$cxn->execute();
$cxn->setFetchMode(PDO::FETCH_ASSOC);
print "<script>";
while($row = $cxn->fetch())
{
print $row['scriptCode'];
// increase the counter
$i++;
}
print "</script>";
// print the counter
echo "Number of rows: $i";
}
broj1
Nearly a Posting Virtuoso
1,211 posts since Jan 2011
Reputation Points: 167
Solved Threads: 164
Skill Endorsements: 13
Have you tried to count the actual records that the query returns as I suggested in my next post? Or have you tried to test the query in phpmyadmin?
broj1
Nearly a Posting Virtuoso
1,211 posts since Jan 2011
Reputation Points: 167
Solved Threads: 164
Skill Endorsements: 13
Question Answered as of 8 Months Ago by
broj1