You are here: Problem with php/mysql count() function showing « PHP Programming Language « IT news, forums, messages
Problem with php/mysql count() function showing

Posted by auron on 11/18/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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация