Hye guys,
Just wanna ask about how to recall data from database using JFactory::getDBO();
Very appreciate if ur guys can show some tutorial or simple coding for guide me.
This code i wanna to insert into Form HTML inside chronoform.
Thank You.
Just wanna ask about how to recall data from database using JFactory::getDBO();
Very appreciate if ur guys can show some tutorial or simple coding for guide me.
This code i wanna to insert into Form HTML inside chronoform.
Thank You.
Hi Kayrie,
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.
Have you tried searching here - there are probably a few hundred examples . . .
Bob
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.
Have you tried searching here - there are probably a few hundred examples . . .
Bob
Hi Kayrie,
In the Form HTML
Bob
In the Form HTML
$db =& JFactory::getDBO();
$query = "
SELECT `some_column`, `another_column`
FROM `#__some_table`
WHERE `some_column` = 'some value' ;
";
$db->setQuery($query);
$data = $db->loadObjectList();
?>
. . .
<?php echo $data->column_name; ?>
. . .Bob
Hye bob,
Thanks for helping.
I'm have a question wanna to ask you.
Actually i have a two form that one for submit the request made by student and second is a form that for their teacher to approve their request.
For the submit one no problem. But for the approve one i have a problem in list back all their data that their submitted.
How does i show back their data back and have an approve button on it?
Thank You.
Thanks for helping.
I'm have a question wanna to ask you.
Actually i have a two form that one for submit the request made by student and second is a form that for their teacher to approve their request.
For the submit one no problem. But for the approve one i have a problem in list back all their data that their submitted.
How does i show back their data back and have an approve button on it?
Thank You.
Hi Kayrie,
In ChronoForms v3 I'd use the Profile Page plug-in to re-load the data for display and add a couple of submit buttons for approve and disapprove.
Bob
In ChronoForms v3 I'd use the Profile Page plug-in to re-load the data for display and add a couple of submit buttons for approve and disapprove.
Bob
Hye bob,
Just wanna ask you.
I have a leave form that i connect it to two table.
first table is a full detail of requested leave.
second one is a table that will grab the value from table one.
eg :
field name : totalrequest
when user insert the total and submit the value. it will store at table one totalrequest field name
and will also store the value in table two totalrequest field name. So what i want to make when second time it insert the value total it will replace the value in table two totalrequest field name only.
in table one value still there but it in other row. table two is just update the value previously but table one grab it as new request@data..
Just wanna ask you.
I have a leave form that i connect it to two table.
first table is a full detail of requested leave.
second one is a table that will grab the value from table one.
eg :
field name : totalrequest
when user insert the total and submit the value. it will store at table one totalrequest field name
and will also store the value in table two totalrequest field name. So what i want to make when second time it insert the value total it will replace the value in table two totalrequest field name only.
in table one value still there but it in other row. table two is just update the value previously but table one grab it as new request@data..
Hi Kayrie,
If find I hard to follow what you are doing here. If it is more than a simple table insert or update then you are probably going to have to write the MySQL queries by hand.
Bob
If find I hard to follow what you are doing here. If it is more than a simple table insert or update then you are probably going to have to write the MySQL queries by hand.
Bob
Hye bob,
i tried to recall back the data from the db. But nothing came up at the form.
Anything wrong with this code you think?
i tried to recall back the data from the db. But nothing came up at the form.
Anything wrong with this code you think?
$db =& JFactory::getDBO();
$query = "
SELECT `currentbalance_id`,
FROM `#__jos_chronoforms_balance`
WHERE `cf_user_id` = 'id' ;
";
$db->setQuery($query);
$data = $db->loadObjectList();
?>
<?php echo $data->currentbalance_id; ?>
. . .
Hye bob,
Recently i create a form that saved detail on db.
Once it saved it create a new data field in table at db.
So, how does for me to make the table does not create new field.
Means the data just update the previous data?
Thank You.
Recently i create a form that saved detail on db.
Once it saved it create a new data field in table at db.
So, how does for me to make the table does not create new field.
Means the data just update the previous data?
Thank You.
Hi Kayrie,
If you want to edit a record then you need to ensure that the value of the record primary key is included in the form as a hidden input.
Bob
If you want to edit a record then you need to ensure that the value of the record primary key is included in the form as a hidden input.
Bob
Hi Bob,
The value of the record i have included in the form.
But when i submit new data, the data does not seem update the old one.
I think the query still use insert. How does can i change the insert query to update one?
The value of the record i have included in the form.
But when i submit new data, the data does not seem update the old one.
I think the query still use insert. How does can i change the insert query to update one?
Hi kayrie,
If the value of the primary key already exists in the database table the record will be updated; if there is no value or the value does not exist then a new record will be created.
I'm afraid that you just need to debug your code line by line.
Bob
If the value of the primary key already exists in the database table the record will be updated; if there is no value or the value does not exist then a new record will be created.
I'm afraid that you just need to debug your code line by line.
Bob
Hi Bob,
Thanks. To update the table i have succeed but back to my previous question about this code :
Nothing happen to. Anything wrong with it?
Thank You.
Thanks. To update the table i have succeed but back to my previous question about this code :
$db =& JFactory::getDBO();
$query = "
SELECT `currentbalance_id`,
FROM `#__jos_chronoforms_balance`
WHERE `cf_user_id` = '62' ;
";
$db->setQuery($query);
$data = $db->loadObjectList();
?>
<?php echo $data->currentbalance_id; ?>
. . . Nothing happen to. Anything wrong with it?
Thank You.
Hi Kayrie,
The table name looks wrong - it should probably be FROM `#__chronoforms_balance` Otherwise it looks OK.
Bob
The table name looks wrong - it should probably be FROM `#__chronoforms_balance` Otherwise it looks OK.
Bob
Hi Bob,
Thanks for reply.
I tried my best by do as you told. But still nothing happen.
I changed the code :
Thank You.
Thanks for reply.
I tried my best by do as you told. But still nothing happen.
I changed the code :
<?php
$db =& JFactory::getDBO();
$query = "
SELECT `currentbalance_id`,
FROM `#__chronoforms_balance`
WHERE `cf_user_id` = '62' ;
";
$db->setQuery($query);
$data = $db->loadObjectList();
?>
<?php echo $data->L_currentbalance_id; ?>Thank You.
Hi kayrie,
Then I'm afraid that you need to debug your code. There isn't anything obviously wrong with the PHP you posted so maybe the logic doesn't work.
Bob
Then I'm afraid that you need to debug your code. There isn't anything obviously wrong with the PHP you posted so maybe the logic doesn't work.
Bob
This topic is locked and no more replies can be posted.
