Hello ,
i meet stuff to delete record on list with chronoforms V4,
i have form which containts DB multi loader the data are displaying in table all rows have two submit link "edit "- "delete".also it containts an other form with input text to create a new record
i'v used hidden fields to edit and modify the record, it works good.
to delete record i'v used this url in the column
del_record is the forms which containts code to delete:
please explain how should i do .
i want to pass the cf_id from the url to del_record
is the url correct?
best regards
latifa
i meet stuff to delete record on list with chronoforms V4,
i have form which containts DB multi loader the data are displaying in table all rows have two submit link "edit "- "delete".also it containts an other form with input text to create a new record
i'v used hidden fields to edit and modify the record, it works good.
to delete record i'v used this url in the column
<td style="border-bottom:1px solid #CCCCCC;">
<a href="index.php?option=com_chronoforms&task=del_record&cf_id=<?php echo $etat['cf_id'];?>">delete</a>
</td>
del_record is the forms which containts code to delete:
<?php
$task = JRequest::getString('task', '', 'get');
if ( $task = 'del_record' ) {
$cf_id = = JRequest::getInt('cf_id', '', 'get');
if ( $cf_id 0 {
$db =& JFactory::getDBO();
$query = "
DELETE
FROM `perso_etat_commande`
WHERE `cf_id` = '{$cf_id}' ;
";
$db->setQuery($query);
$db->query();
}
}
$mainframe =& JFactory::getApplication();
$mainframe->redirect('index.php');
?>
please explain how should i do .
i want to pass the cf_id from the url to del_record
is the url correct?
best regards
latifa
HI latifa,
I have already told you more than once that there are serious errors in the PHP that you are using. Until you correct these there is little point in re-posting the same broken code.
I also don't understand where $etat comes from or what task=del_record does in the URL. That looks like a mixture of a ChronoForms and a ChronoConnectivity URL.
Bob
I have already told you more than once that there are serious errors in the PHP that you are using. Until you correct these there is little point in re-posting the same broken code.
I also don't understand where $etat comes from or what task=del_record does in the URL. That looks like a mixture of a ChronoForms and a ChronoConnectivity URL.
Bob
hi Bob ,
$etat is form->data[table] ,
i'v found this php code in this forum i don't master PHP am just begginer ,
how should my code be ? can u explain me how can i delete record on my list please.
thanks Bob
CDT
$etat is form->data[table] ,
i'v found this php code in this forum i don't master PHP am just begginer ,
how should my code be ? can u explain me how can i delete record on my list please.
thanks Bob
CDT
Hi,
I think that everything should work ok as long as this piece returns the row's id:
And this depends on the main list, the variable $etat is not defined here.
Regards,
Max
I think that everything should work ok as long as this piece returns the row's id:
<?php echo $etat['cf_id'];?>
And this depends on the main list, the variable $etat is not defined here.
Regards,
Max
Hello Max,
Thx a lot for reply,
i'v defined $etat on the form which containts list of record on the DB multirecord loader i'v made $form->['table_name'] as $etat
Max is the URL correct <a href="index.php?option=com_chronoforms&task=del_record&cf_id=<?php echo $etat['cf_id'];?>
best regards
Thx a lot for reply,
i'v defined $etat on the form which containts list of record on the DB multirecord loader i'v made $form->['table_name'] as $etat
Max is the URL correct <a href="index.php?option=com_chronoforms&task=del_record&cf_id=<?php echo $etat['cf_id'];?>
best regards
Hi latifa,
I'm repeating myself again, if you want help here please listen to it.
These three lines are all broken and will not work
Bob
I'm repeating myself again, if you want help here please listen to it.
These three lines are all broken and will not work
if ( $task = 'del_record' ) {
$cf_id = = JRequest::getInt('cf_id', '', 'get');
if ( $cf_id 0 {
Bob
Anyway the line of code with $etat must be returning some value, if it doesn't then don't expect the next step to work correctly, assuming the code is correct.
And it looks like I didn't check your code well earlier, Bob has found some error which need to be fixed, here is a fixed version for the 3 lines:
Actually where did you place this code ? you should have received a PHP syntax error!
And it looks like I didn't check your code well earlier, Bob has found some error which need to be fixed, here is a fixed version for the 3 lines:
if ( $task == 'del_record' ) {
$cf_id = JRequest::getInt('cf_id', '', 'get');
if ( $cf_id ) {
Actually where did you place this code ? you should have received a PHP syntax error!
hello,
tanks so much for your help
i'v fixed my code and it still doesn't work , is there any setting to do ?
CDT
tanks so much for your help
i'v fixed my code and it still doesn't work , is there any setting to do ?
CDT
I suggest using ChronoConnectivity v5 for CRUD operations.
Regards,
Max
Regards,
Max
This topic is locked and no more replies can be posted.