Welcome Guest, Not a member yet? Register   Sign In
Session data
#21

[eluser]triplewhat[/eluser]
I have it right on my page, i just typed it wrong here
#22

[eluser]Ajaxboy[/eluser]
Try this is let me know what you see...


Code:
function validate()
{
  $this->db->select('username, password, title');
  $this->db->where('username', $this->input->post('username'));
  $this->db->where('password', $this->input->post('password'));
  $query = $this->db->get('users')->row_array();
  
  die("data<pre>".print_r($query,1));

  if($query)
  {

   return $query;
  }
  die("Your login info is not good");
}
#23

[eluser]Ajaxboy[/eluser]
ahhh I see your issue...

Code:
instead of $this->db->select('username', 'password', 'title');

do

Code:
$this->db->select('username, password, title');
#24

[eluser]triplewhat[/eluser]
that still didnt fix it. I really appreciate your help though. Smile what now
#25

[eluser]Ajaxboy[/eluser]
what error are you getting? did you try the previous code on post #21?
#26

[eluser]triplewhat[/eluser]
data
Array
(
[username] => admin
)


thats what it returned
#27

[eluser]Ajaxboy[/eluser]
well there is the issue. It should return the title AND the password too because you are selecting it. If it doesn't then that's not an issue in the code and I wouldn't know how to help.

try it like this instead, you don't need to select the password anyways

Code:
$this->db->select('username, title');
#28

[eluser]Ajaxboy[/eluser]
Code:
function validate()
{

if(!$this->input->post('password') || !$this->input->post('username')) {
  return;
}
  $this->db->select('username, title');  
  $this->db->where('username', $this->input->post('username'));
  $this->db->where('password', $this->input->post('password'));
  $query = $this->db->get('users')->row_array();
  
  die("data<pre>".print_r($query,1));

  if($query)
  {

   return $query;
  }
  die("Your login info is not good");
}
#29

[eluser]triplewhat[/eluser]
lol oops I copied that code in 21 and it still had ('username', 'password', 'title')

I changed it and it works perfectly, thank you very much ajax




Theme © iAndrew 2016 - Forum software by © MyBB