Jump to content

[SOLVED] Framework help


adam291086

Recommended Posts

Hello,

 

i am using codeignighter frameword here is my class

 


<?php

class UserForm extends Controller {

function index()
{
	$this->load->helper(array('form', 'url'));

	$this->load->library('form_validation');

	$this->form_validation->set_rules('username', 'Username', 'required');
	$this->form_validation->set_rules('password', 'Password', 'required');


	if ($this->form_validation->run() == FALSE)
	{
		$this->load->view('login');
	}
	else
	{
		$query_username = $_POST['username'];    // query username
            $query_password = $_POST['password'];    // query password
            $query = $this->db->query("SELECT * FROM persons WHERE username='".$query_username."' AND password='".$query_password."'");

            foreach ($query->result() as $row)
            {
                echo $row->username;
            }
                       

	}
}

}
?>

i am getting the error message

 

Fatal error: Call to a member function on a non-object in /homepages/12/d214897219/htdocs/adam/framework/system/application/controllers/userform.php on line 23

 

and i dont know why?

Link to comment
https://forums.phpfreaks.com/topic/155189-solved-framework-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.