Quick Query Question...
Posted: Mon Aug 12, 2002 7:52 pm
Ok, I have a column in a mySQL table that is default blank.. nothing in it, and then some have the letter Y in the cell, I've been trying to make a script that tells me how many Y's I have filled in... I've been trying a foreach loop, but... it keeps giving me errors when trying to parse it.
like.. something like this...btw no problems whatsoever connecting to the database, or displaying stuff, works fine without this stuff...
am I going about this the wrong way..(well obviously) but I mean is there something wrong with my sytax, or.. is there a query function I could setup to do this and give and total in integer form...?? thanx.. reply if you have anymore questions
Also $payed is the thing where it either is Y or it isn't, and earlier its taken from the database and made into a variable for an earlier thing of being put into an HTML table...
btw
like.. something like this...btw no problems whatsoever connecting to the database, or displaying stuff, works fine without this stuff...
Code: Select all
$total = 0;
$payed2 = "Y";
foreach ($payed = $payed2) {
$total + 1 = $total;
}Also $payed is the thing where it either is Y or it isn't, and earlier its taken from the database and made into a variable for an earlier thing of being put into an HTML table...
btw