phplearner_null's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
New Members
Active Posts:
2 (0 per day)
Joined:
27-December 12
Profile Views:
696
Last Active:
User is offline Jan 01 2013 09:56 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   phplearner_null has not set their status

Posts I've Made

  1. In Topic: Inserting data into database is not working in joomla 2.5

    Posted 31 Dec 2012

    View PostBerndB, on 31 December 2012 - 08:59 AM, said:

    Hi,

    you forgot the ` before the name field

    $query = "INSERT INTO `#__jd` (`id`,name`, `class`)
        VALUES ('',$name, $class);";
    
    

    so i mean it will work:
    $query = "INSERT INTO `#__jd` (`id`,`name`, `class`)
        VALUES ('',$name, $class);";
    
    


    Bernd

    Thanks BErndB for the reply. Yeah, i'd forgot to insert ` in name and also i forgot to put '' in $name and $class. That's why it was not working, so i have changed it and now everything is working well....Below is the update code.
           $db =& JFactory::getDBO();
     $query = "INSERT INTO `#__jd` (`id`,`name`, `class`)
     VALUES ('','$name', '$class');";
     $db->setQuery( $query );
     $db->query();
    

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

phplearner_null hasn't added any friends yet.

Comments

phplearner_null has no profile comments yet. Why not say hello?