CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 sql query in an event

Print topic Send  topic

Author Message
David Hopkins
Posted: 11/20/2002, 1:31 PM

Hello all,

I am trying to run a sql query from an after insert event.

What i waht to do:

$exesql = 'delete * from temp1 where delete1="yes"';
$this->query($exesql);

I get an error undefind functiona call. How do I fix this so that I can
run this from the code. I am running php 4.2.3

JD
Don Anderson
Posted: 11/21/2002, 3:18 AM

Hi,

This is a common frustration. The tutorial and manual are not very clear on
this point.
You have to declare globals, otherwise it will never work. :-)

Here is an example.

global $"<insert_your_control_name>"; // Don't include the quotes marks.
global $DB"<insert_your_connection_name>";

// Then you need to assign the db handle.
// You can use an existing one e.g.
$db = $"<insert_your_control_name>"->ds;

// OR sometimes I prefer to create a new db handle.

$db = new clsDB"<insert_your_connection_name>";

// So then your code becomes.

$exesql = 'delete * from temp1 where delete1="yes"';
$db->query($exesql);

Good Luck,
Don Anderson


"David Hopkins" <fenris@one.net> wrote in message
news:3DDBFF14.BBEBA623@one.net...
> Hello all,
>
> I am trying to run a sql query from an after insert event.
>
> What i waht to do:
>
> $exesql = 'delete * from temp1 where delete1="yes"';
> $this->query($exesql);
>
> I get an error undefind functiona call. How do I fix this so that I can
> run this from the code. I am running php 4.2.3
>
> JD
>


   


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.