Forums

Form to SQL Phoca

bambid 11 Apr, 2012
Hello

I got a big Problem.

I need a SQL Insert in the database for a special phoca guestbook for this registred User.

This is what i got:

OnSubmit - Custom Code - Before Email(s)
<?php
$form=$x_data['VerName'];
$check0=$x_data['check0'];
if ($check0 == "Ja"){
$con = mysql_connect("frickta1.mysql.db.internal","frickta1_jo1270","fesu8vavu");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("frickta1_jo140", $con);

$sql = "INSERT INTO jos_phocaguestbook_books (title) VALUES (\'$form\');";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "1 record added";

mysql_close($con);
}
?> 


But in the Database is no input.

Where is the mistake?

Thanks
bambid
GreyHead 12 Apr, 2012
Hi bambid ,

You have some very mixed code there?

Which version of ChronoForms are you using? You can find the version from Site Admin | Extensions | Install/Uninstall | Components in Joomla! 1.5 or Site Admin | Extensions | Extension Manager | Manage in Joomla! 1.6/1.7/2.5.

Bob
This topic is locked and no more replies can be posted.