The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue May 08, 2012 5:03 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Apr 09, 2012 9:44 pm
Posts: 6
Hi guys! I'm working on a component in the administrator backend that handles entries for a slideshow. It will retrive the data from the database and display it and it will also delete rows but it will not update rows or create new ones. To do this I'm using the page here: http://docs.joomla.org/Using_the_JTable_class

Following is the code I'm using from my controller.php file:
Code:
function add(){
        $row =& JTable::getInstance('fpssss','Table');

        if(!$row->bind(JRequest::get('post'))) return JError::raiseError(500, $row->getError());
        if(!$row->store()) JError::raiseError(500, $row->getError());

        $postdata = "";
        foreach(JRequest::get('post') as $key){
            $postdata .= $key.", ";
        }

       $this->setRedirect('index.php?option=com_fpssss', 'Slide Added Succcessfully! '.$postdata);
    }

    function edit(){
        $row =& JTable::getInstance('fpssss','Table');

        if(!$row->bind(JRequest::get('post'))) return JError::raiseError(500, $row->getError());
        if(!$row->store()) JError::raiseError(500, $row->getError());

        $postdata = "";
        foreach(JRequest::get('post') as $key){
            $postdata .= $key.", ";
        }

       $this->setRedirect('index.php?option=com_fpssss', 'Slide Edited Succcessfully! '.$postdata);
    }


Whenever I try to edit an entry or create a new one it returns with the successful message and prints out the post data like it's supposed to. The data it shows me is always correct. Unfortunately nothing in the database changes. Strangely, it did work one time but I immediately tried again, without changing anything, and it was back to not working. Any ideas?

Thanks!


Top
 Profile  
 
PostPosted: Wed May 09, 2012 9:31 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Apr 09, 2012 9:44 pm
Posts: 6
Bump?


Top
 Profile  
 
PostPosted: Mon May 14, 2012 4:47 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Apr 09, 2012 9:44 pm
Posts: 6
Bump-bump?


Top
 Profile  
 
PostPosted: Thu May 24, 2012 2:20 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Apr 09, 2012 9:44 pm
Posts: 6
Nothing? Well, at least we only have to keep using Joomla for a few more months.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 



Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group