CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 ds->RecordsCount Returns 0 w/ Php,MSSQL, Stored Procedures

Print topic Send  topic

Author Message
njtech

Posts: 1
Posted: 04/20/2004, 2:53 PM

I have run into a issue with PHP using MYSQL lib not ODBC,
with $MS SQL.

Basicly just checking for Record counts. using ds->RecordsCount With Php against stored
procedures. The problem is they always return 0. I tested via echo to see this... and against a regular sql statement it it works
showing # of records.

This works with ok ASP + the same stored procedures.Has anyone run into this before?


Thanks
Larry.
View profile  Send private message
Thomas S.
Posted: 05/22/2004, 6:08 AM

MySQL 4 does not have stored procedure functionality. MySQL 5 will have such functionality. But it is only Beta for now.

But there is a trick how to implement stored procedure functionality in MySQL 4.

I wrote a table called views. For the minimum you need 3 columns:
vws_id auto increment  
vws_name varchar(32)  
vws_def (mediumtext)

Do place your query in column vws_def. Name it unique.
Once you setted up your database that way, your are able to put your queries into the database.

Override your page's initial query by a before excecute select event with the coding below:
  
$db = new clsDBConnection(); // Initialize a new connection  
$SQL = "SELECT * FROM views WHERE vws_name='{your_query_name}' "; // the query  
$db->query($SQL); // execute query  
while($db->next_record()) // retrieve data  
{  
  $formular->ds->SQL = $db->f("vws_def"); // get view  
}  
$db->close(); // close connection  

By that way the page will override the original query. Now, the script will executed the stored query, or call it stored procedure.
You can build up a table with further columns. So it is possible to manipulate the page action via events for different output.

Lawrence Remaley
Posted: 05/22/2004, 7:44 AM

I made a typo in the post. I was using the MSSQL lib with MSSQL not MYSQL database.
I was actually using SP with MSSQL. Code charge dosn't return a record count with Store procs. and PHP, but does with ASP. The workaround is to get record count via the grid instead with the after execute event.

Thanks for your reply , and that is some interesting info on your post
using the workaround for MYSQL and SP.

Add new topic Subscribe to topic   


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.