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

 Redirect when no records found

Print topic Send  topic

Author Message
mb
Posted: 10/28/2002, 6:17 PM

I would like to have a search redirected to a page with record form when the search result returns no records found

Can someone help

CCS 1.0.7 and php
Nicole
Posted: 10/30/2002, 6:19 AM

Hello,
To find if the recordset is empty you should open new connection in the form Before Show event and execute the same query as used for the grid form. Check if returned recordset is empty and then redirect user if it is. Here is sample code:
global $form_name;
$conn = new clsDBconnection_name();
$conn->query(CCBuildSQL($form_name->ds->SQL, $ form_name->ds->Where, $ form_name->ds->Order));
if (!$conn->next_record())
header("Location: AnyPage.php");

   


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.