delete a record in the table

federici 07 Jun, 2012
Hi,

i have a problem with the delete a record, i have a form with one textbox and i need to delete into the db the record that the user write in the textbox.

i used the Custom Code in On Submit and i wrote this code

<?php
        
    $db =& JFactory::getDBO();
    $query = "DELETE FROM 'j6pjb_chrono_tab' WHERE 'nome_imp'='".JRequest::getVar('rimuovi_imp')."'";
    $db->setQuery($query);
    $db->query();
  
?>


'nome_imp'='".JRequest::getVar('rimuovi_imp')."'"


i'm not sure that this is the system for get the value inside the textbox



The code is a mix of info found on the web, sorry but i'm not a good user of joomla😟
GreyHead 07 Jun, 2012
Hi federici,

In MySQL queries, table names and column names must be wrapped in back quotes `` and not straight quotes ''.

Bob
This topic is locked and no more replies can be posted.