Hi
I am a php/mysql newbie ...
I want to get the number of items(number people registered for some event) in different table columns so if they are more than a a certain number X, no more registrations are possible.
I tried that using the following methods given me in another forum:
SELECT COUNT(*)
FROM itmc_anmeldungen
WHERE s1t1 <> '';
To retrieve the count of rows where s1t1 is not null:
SELECT COUNT(*)
FROM itmc_anmeldungen
WHERE s1t1 IS NOT NULL;
And you can combine them:
SELECT COUNT(*)
FROM itmc_anmeldungen
WHERE s1t1 IS NOT NULL AND <> '';
... with the syntax below:
$abfrage = "SELECT COUNT(*) FROM itmc_anmeldungen WHERE s1t1 <> ''";
$bingo = mysql_query($abfrage);
echo "<b>$bingo</b>";
For some reason, the first 2 give the result: "Resource id #4"
and the third in exactly the same format, ie with "WHERE s1t1 IS NOT NULL AND <> ''"
does not output anything.
In the database, there are currently 3 "s1t1" items, which I expect as the result.
I suppose there is something wrong with my query ...
What should I do differently?
As said, I know very basic Mysql/php, so I request for some specific answers. (I have got a good number of suggestions from different php forums, but either they dont give the expected answer OR, I do not know how to use the suggested queries to get to the result)
OR ... is there any other or better way of getting the result?
Thanks & regards