Posted by auron on 10/24/69 11:40
Hi there,
I have a really stupid and banal problem with showing the results of a
MySQL query in PHP, preciselly with MySQL count() function that gives
to a variable in PHP the result.
NOTE:
The problem here is PHP not MySQL, in MySQL everything works just
fine.
Here is the query that I wrote for getting the number of how much
records I have in my litte and tottaly trivial DB:
------------------------------ CODE ----------------------
$res = @mysql_query("SELECT COUNT(*) FROM my_data_table");
echo ($res);
------------------------------ CODE ----------------------
PS: my_data_table is a name of table not a function or other MySQL
related syntax.
The result of this query on the screen is:
Resource id #4
I was around the net and I get some info that don't give me help.
The solution from the net was to insert the value of the variable (in
this case $res) in a function like mysql_fetch_object or
mysql_fetch_row etc.
After some hours of trying to do something wtih those functions I
started to think that getting how much records I have in my DB is
almost a thing that only persons with a extremlly huge brain can
concive and only a few superior entities can made.
:)
Can some body with a huge brain help me?
Thank you in advance.
Auron
PS: I'm not a PRO I get only started to lear about PHP and MySQL.
because somebody have told me that "was" easy to make some thing with
those 2 tool.
http://eye.cc php newsgroups
[Back to original message]
|