• 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: Read & Write values to - From a MySql database

Read & Write values to - From a MySql database 3 years 4 months ago #41728

  • dan429
  • dan429's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Does anyone know how to read and write data from a MySQL database. Everyone make a contact form and a form that can email a submission. I need to be able to prefill a form (including a text field and then write any changes back to the database.
The administrator has disabled public write access.

Read & Write values to - From a MySql database 3 years 4 months ago #41738

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 246
  • Thank you received: 64
I use this to read a number from a table and prefiil a field, this is for a single result but the principle is the same, placed in the pre processing - before display section.
//Get number from database and use for submitting member
$db = JFactory::getDbo();
    $db->setQuery("SELECT `next_number` FROM `your database`.`mem_rsfmember_number` ");
$value = $db->loadResult();
$val['next_memnumber'] = $value;

here's a link to the Joomla docs

updating your tables is simple using 'mapping' just remember to get the where clause right
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
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!