CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 How to query for total records (CC not CCS)

Print topic Send  topic

Author Message
Wizy
Posted: 01/31/2003, 7:27 PM

Trying out both programs....CCS isn't living up to what i need done, and i remember having some success with CC, but can't find information on doing this.

How would you query for total records in the DB using CC?

also, does CC support 2 databases?
Peter
Posted: 01/31/2003, 9:35 PM

2 databases: http://www.gotocode.com/art.asp?art_id=96&

RonB
Posted: 02/01/2003, 4:08 AM

The same way as in CCS.... select count(*) from tabel

CCS rocks if you take the time to learn. CC roks because you will start making db driven sites in minutes. The extra features off CCS are well worth the extra effort though.

Ron
GreggB
Posted: 02/03/2003, 7:11 AM

Another solution:

I use the following method as it will display the record count based on the current query from a search page.

Add the following code in the “BeforeShow Event of the Forms Gird” that you want to display the records count.

fResult = dResult * iRecordsPerPage
SetVar "total_count", fResult

Now in the same page under Forms create a “Menu” form and in “Fields” add a field type “Label”. In the “Caption” add the following code.

<p><b>Total Records {total_count}</b></p>


This will display the Total Records based on the query from the search page. If you always just want the total records regardless of the query, you should then use Ron’s method.

Hope this makes sense to you as I have not gone into great detail.

GreggB
Wizy
Posted: 02/03/2003, 12:55 PM

http://www.gotocode.com/art.asp?art_id=96& - 2 Database example

Im getting an error about redelcaring:

Fatal error: Cannot redeclare class db_sql in c:\apache\htdocs\links\db_mysql.inc on line 12

On line 12 - 18 it says:

class DB_Sql {

/* public: connection parameters */
var $Host = "";
var $Database = "";
var $User = "";
var $Password = "";


Im working with the LInks sample in CC, and using the db for links to list, but using another DB for administration (its just using the login name and password from another table in that dB).


Can someone explain thoroughly on how to include 2 databases in one project for CC. The example/article in the above page doesn't say which pages to include the extra common.php file since I need both. Is there a way to just rewrite the common.php file to include both db's? And i need connections to both all the time (on each page), not just one time once.
Wizy
Posted: 02/03/2003, 1:42 PM

GreggB

Your example is producing an error:

parse error in c:\apache\htdocs\links\itemslist.php on line 404


Could you explain it again, in better detail? Do i creat an new form? Grid? etc.
GreggB
Posted: 02/03/2003, 2:00 PM


The example I gave, tested and used in CC is intended for use with one database. I have moved all my projects to CCS, which allows for multiple databases.

I recommend you take the time to learn CCS, which is designed to use multiple databases, requires less special coding and is more robust.

Based on the questions you have been posting, I believe you will find yourself always trying to find a work around in CC to accomplish your results and goals.

Sorry I can’t help you further in CC with two databases as I no longer use CC.

GreggB.
Wizy
Posted: 02/03/2003, 2:02 PM

"The same way as in CCS.... select count(*) from tabel"


And in the other thread, I stated that the select count(*) didn't work for CCS and went with another solution.


Where do I put this? In a grid? Form? Record? menu? Before Show? Sql?
Wizy
Posted: 02/03/2003, 2:30 PM

GreggB


Gregg, I found out why the error was happening. Instead of using your code, I just implemented my own and used a variable intead to display the amt of records. But your way, was correct.
t

Thanks, 2nd time your coding worked with a few minor edits.
GreggB
Posted: 02/03/2003, 2:58 PM


Great and I appreciate the feed back when something works or not since I have not used CC for sometime now.

GreggB
Wizy
Posted: 02/03/2003, 3:31 PM



As for CCS. sorry, can't afford it, and im stuck with CC. If it were cheaper, then I'd get it. At this point in time, I dont find CCS worth the $200+ price tag.
Mikevg
Posted: 02/17/2003, 3:40 PM

Gregg,

Happened on your solution whilst looking to resolve a problem. Using CCS with PHP - works a treat!

Just to let you know that you're appreciated!!!

Best regards

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.