Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • joomla insert,update and delete

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 265
    Comment on it

    WE can easily manipulate our data from database in Joomla by using the below code. First need to call jfactory::getDBO$db = &JFactory::getDBO(); returns a reference for the database object in joomla.

    For INSERT query in Joomla structure

    $db = &JFactory::getDBO();
                 $insertquery = "INSERT into #__TABLENAME(feild1,feild2) values('value1','value2') ";
                 $db->setQuery( $insertquery );
                 $db->query();
    

    For UPDATE query in Joomla structure

         $updatequery = "UPDATE #__TABLENAME SET feild1 = 'value1' ";
         $db->setQuery( $updatequery );
         $db->query();
    

    For DELETE query in Joomla structure

    $deletequery = "DELETE FROM #__TABLENAME WHERE feild1 = 'value1' ";
             $db->setQuery( $deletequery );
             $db->query(); 

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: