• 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: how to fetch data from db

how to fetch data from db 16 years 10 months ago #4507

Hi!

I am working on Rsformpro, i really like how RSformPRO works but i need a script to complete my form, i want to pull data from a table and fill all the fields with the data when the form loads.
I have gone through the forum and the user guide but code listed there is not working for me.
if this is not possible can you please say how we can identify the field name and its value when the form loads.

what i tried is this

foreach($fields as $i=>$field){
if($field->name=='selection')//where selection is the filed name{
$fields[$i]->default_value ='empty';
}
}

it is not working for me. please help me with this, it will really make me vwry happy if your suggestion works.

eagerly waiting for your replay
Ramchandran S
The administrator has disabled public write access.

Re:how to fetch data from db 16 years 9 months ago #4866

Found this on this forum

//<code>
global $database, $my;//global declaration
$mydata = $my->id;//fetching the user id who has logged in
if($mydata!=0)
{
$data = mysql_query(\"SELECT * FROM jos_comprofiler WHERE id = '\".$my->id.\"' \")
or die(mysql_error());//this query will fetch you the record of that particular user
while($info = mysql_fetch_array( $data ))
{
return $info;//return the name of the user which will be populated in the text filed
}
}
else
{
return 'no record';
}
//</code>

This is put into the Default Value for every field you want prefilled - the example abve I'm taking the firstname from community builders fields
The administrator has disabled public write access.

Re:how to fetch data from db 16 years 9 months ago #4890

Hi!

Try this

www.rsjoomla.com/index.php/RSform-Script...fo-for-RS-Forms.html

to get the specific filed data...
still the if you have any problems let me know.
The administrator has disabled public write access.

Re:how to fetch data from db 15 years 3 months ago #10109

  • servicefly
  • servicefly's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 22
  • Thank you received: 1
Can this code me written to pull from a different table for a query related to matching phone numbers?

Example: I need to populate a field with an email address if the phone number entered matches the same record as the email.

More specific: I need to query the table jos_rsform_submissions_values for a phone number entered into field 1. When the phone number matches, the email for the same record is called into the field 2.

I think most of the code above would work, but I need code that doesn't call the user's info, rather it calls data matching field 1 input.
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!