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
    • 268
    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

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

    For UPDATE query in Joomla structure

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

    For DELETE query in Joomla structure

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

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: