CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Counting Records (Counting Sheep is not working)

Print topic Send  topic

Author Message
Wizywyg
Posted: 01/24/2003, 2:36 PM


Okay, Im not submitting a search form to find out how many records to be displayed.

Counting sheep doesn't work for what i need to do, and Im coming up with errors:

Parse error: parse error in c:\apache\htdocs\mdb\newpage1.php on line 89


Which is:
$this->Label1->SetValue(NewGrid1*.datasource.Recordset.RecordCount());


I have table in the DB called: aweb_title
I have , for example, 300 records listed in this table.

Can CCS with PHP return that number when called for it, in Text format? And how do you set it up?

<b>Total Amt of Records:</b>****Number****
WizyWyg
Posted: 01/24/2003, 4:05 PM

For now, just did my own php coding to get it to work..
for those intrested, in just finding out how many records are in a database, but without submitting a form to find out.

Create a simple label from the form menu (name it to whatever you want); in the properties box, leave everything default, but in the DEFAULT value type in:

echo"$num_rows"

Now, go into the CODE editing part of your page, and manually type this in:

// custom code
$db_name = "YOURDATABASENAME";
$connection = mysql_connect("YOURSERVER","YOURUSERNAME", "YOURPASSWORD");
$db = mysql_select_db($db_name,$connection);
$q = "SELECT * FROM YOURTABLE";
$result = mysql_query($q) or die(mysql_error().$q);
$num_rows = mysql_num_rows($result);
// end custom code

Replace anything in captial letters with appropriate values.
YOURTABLE should be the table in the DB that you want to find out how many records exist

If anyone knows how to correct the above coding to fit in with the way CCS connects to the DB, please post.


So in the Design portion, as I have it:

Total Amt. of Records : {label}

Ie Total Amt. of Recors : 300
Wizywyg
Posted: 01/24/2003, 4:33 PM

Sorry the default value should read "$num_rows" (dont put echo)
lneisius
Posted: 01/25/2003, 6:57 AM

Simple in CCS 2.0 Beta 1
1. Pick the label in the form.
2. In before show of event right click and select add action
3. In Popup Select Retrieve number of records.
Function is currently limited. Hopefully this undocumented function will improve in its capabilities as 2.0 final comes out.
Wizywyg
Posted: 01/27/2003, 12:47 PM



There is no "Select Retrieve number of records" in the Pop-up menu on the Add Action.
Wizywyg
Posted: 01/27/2003, 12:50 PM

oh, you are talking about 2.0 beta. Im not using that version.

1.0.7.1 Trial Version. How do you do that in Trial version.

   


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

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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