Welcome Guest, Not a member yet? Register   Sign In
Simple database query
#3

[eluser]s0mmer[/eluser]
[quote author="nicholas.byfleet" date="1253233510"]Ok, a couple of things:
1. Welcome to CI forums... we are glad to have you.
2. What are you trying to do with the extra parameters here:
Code:
$this->load->model(‘register’, ‘’, TRUE);
I usually just put
Code:
$this->load->model('Register');

3. I'm not really a PHP expert, but wouldn't you have to declare your variables like:
Code:
var $createdate;
var $username;
... etc etc.

before function Register() {... ?
3. Since you are not loading any views, it is entirely possible that your script is working just fine. Of course you can tell easily by looking at your database. did it create a new row when you ran it?

4. I usually have my functions return a boolean like this:

Code:
function create_user()
  {
      $this->createdate   = “2009-06-09”;
      $this->username     = “test”;
      $this->password     = “test”;
      $this->email     = “test”;
      $this->name         = “test”;

      if ($this->db->insert(‘pmd_users’, $this)) {
         return true;
      } else {
         return false;
      }
  }
that way, you can use the return value in your controller to load an error view if the procedure is unsuccessful.


In any case, like I said, I am no expert. Hope this is of some help to you.[/quote]

First of all thanks for your reply Smile

I've now tried deleting the ekstra parameters (i thought i should after reading the guide) and also declaring the variables im using. Still just blank screen. I am displaying a view, i just excluded it from this post..


Messages In This Thread
Simple database query - by El Forum - 09-17-2009, 12:29 PM
Simple database query - by El Forum - 09-17-2009, 01:25 PM
Simple database query - by El Forum - 09-17-2009, 01:39 PM
Simple database query - by El Forum - 09-17-2009, 02:03 PM
Simple database query - by El Forum - 09-17-2009, 02:06 PM
Simple database query - by El Forum - 09-17-2009, 02:50 PM
Simple database query - by El Forum - 09-17-2009, 03:58 PM
Simple database query - by El Forum - 09-17-2009, 05:52 PM
Simple database query - by El Forum - 09-17-2009, 05:56 PM
Simple database query - by El Forum - 09-17-2009, 06:02 PM
Simple database query - by El Forum - 09-17-2009, 06:35 PM
Simple database query - by El Forum - 09-17-2009, 08:17 PM
Simple database query - by El Forum - 09-29-2009, 02:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB