setQuery( $sql1 );But it doesn't seem to work...Doesn anyone know how I can realize this?"> Combination Chronoform with letterman - Forums

Forums

Combination Chronoform with letterman

Quevi2008 24 Oct, 2008
Hi,

I want my users - who decide to complete a form - automatically be registered for Letterman. (J1.0.x)

I've tried this in the "Auto Generate"-tab:


$sql1 = "INSERT INTO #__chronoforms_1 VALUES  (
'' , '".$inum."','". date('Y-m-d')." - ".date("H:i:s")."', '".$_SERVER['REMOTE_ADDR']."' , '".mosGetParam($_POST,'email','')."' , '".mosGetParam($_POST,'name','')."' , '".mosGetParam($_POST,'tel','')."');";

$sql1 .= "INSERT INTO #__letterman_subscribers VALUES  (
'' , '','', '".mosGetParam($_POST,'email','')."' ,'1', '')."');";

$database->setQuery( $sql1 );


But it doesn't seem to work...

Doesn anyone know how I can realize this?
GreyHead 24 Oct, 2008
Hi Quevi2008,

You look as though you are close. You'll need to complete the Chronoforms sql query before you start the Letterman one though.
$sql1 = "INSERT INTO #__chronoforms_1 VALUES  (
'' , '".$inum."','". date('Y-m-d')." - ".date("H:i:s")."', '".$_SERVER['REMOTE_ADDR']."' , '".mosGetParam($_POST,'email','')."' , '".mosGetParam($_POST,'name','')."' , '".mosGetParam($_POST,'tel','')."');";
$database->setQuery($sql1);
if (!$database->query()) {
    echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>";
}
$sql2 = "INSERT INTO #__letterman_subscribers VALUES  (
'' , '', '', '".mosGetParam($_POST,'email','')."' ,'1', '')."');";
$database->setQuery($sql2);
if (!$database->query()) {
    echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>";
}

Bob
budfox 18 Nov, 2008
Funnily enough, this is exactly what I want to do.

Chronoforms makes great forms and Letterman does all I need from a newsletter.

Now, to try and learn a bit of coding.....
budfox 18 Nov, 2008
I've just discovered that Letterman has a front-end that does what I want anyway. Shame the documentation is soe woeful or I'd have known that.
This topic is locked and no more replies can be posted.