• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: submitting data to a database

submitting data to a database 16 years 6 months ago #5075

  • rapierce
  • rapierce's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
I am trying my first form with the software. With it I want to submit the data to table in a MySQL database. From the help online, here is the script that I have on submit. It is not throwing any errors, its just not submitting the data to the database. I did remove the password :)

if(isset($_POST)) {
$database2 = $database;
$database2 = new database('172.31.3.75','dbadmin','password','joomla','mbghof');

$database2->setQuery(\"INSERT INTO db_halloffame_frm ('nominee','address','phone') VALUES ('{$processform}', '{$processform}', '{$processform}')\");

$database2->query();

}

Thanks in advance for helping me get started.
The administrator has disabled public write access.

Re:submitting data to a database 16 years 6 months ago #5076

  • octavian
  • octavian's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
Hello,

Try this code:
if(isset($_POST['form']['text'])) {
$database2 = $database;
$database2 = new database('172.31.3.75','dbadmin','password','joomla','mbghof');
$database2->setQuery(\"INSERT INTO db_halloffame_frm (`nominee`,`address`,`phone`) VALUES ('$processform[Nominee]', '$processform[address]', '$processform[phone]')\");
$database2->query();
} 
<br><br>Post edited by: strafe, at: 2008/10/16 14:49
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re:submitting data to a database 16 years 6 months ago #5098

  • rapierce
  • rapierce's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Still nothing in the database. Do I need to change anything on this statement besides the password for access to the database? The data is saving in the form where I can export it to Excel but I want it to submit to a database.

Thanks for your help.

Rick
The administrator has disabled public write access.

Re:submitting data to a database 16 years 6 months ago #5099

  • octavian
  • octavian's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
Hello,

here's one final try:
(this works if the table db_halloffame_frm is in the same database as your Joomla! installation)
if(isset($_POST['form']['nominee']))
{
mysql_query(\&quot;INSERT INTO db_halloffame_frm (`nominee`,`address`,`phone`) VALUES ('$processform[Nominee]', '
$processform[address]', '$processform[phone]')\&quot;);
} 

If you're still having trouble you might be better off submitting a ticket so one of our staff members can test and debug your script in your own environment (eg. logging in to your Joomla! website with an administrator account).<br><br>Post edited by: strafe, at: 2009/01/26 12:08
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re:submitting data to a database 16 years 6 months ago #5467

Hi,

I have the same problem, I've tried the last but itdoesn't work. No exception. NO data in table . Is there any solution ?

best
The administrator has disabled public write access.

Re:submitting data to a database 16 years 6 months ago #5470

I have a similar problem. I can't prefill anything, and I guess it's because the PHP script is not run. Maybe that's your problem as well.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!