Welcome Guest, Not a member yet? Register   Sign In
need help Message: Undefined variable
#1

PHP Code:
public function save(){
 
$this->load->helper('date');
 if(
$_SERVER["REQUEST_METHOD"] == "POST"){
 
$data = array(
 
"USERNAME" => $this->input->post("email"),
 
"PASSWORD" => md5($this->input->post("PASSWORD")),
 
"CREATE_DATE" => NOW(),
 
"STATUS" => 1,
 
"USER_TYPE" =>2
 
 
);
 
$query $this->db->insert("user"$data);
 if(
$query){
 
$this->db->where("email"$this->input->post("email"));
 
$q_profile $this->db->query("SELECT id FROM user WHERE USERNAME ='{"mysql_real_escape_string($this->input->post('email')). "}' LIMIT 1");
 foreach (
$q_profile->result() as $p){
 
 
$uid $p->id;
 
 }
 
 
 
$profile = array(
 
"USER_ID" =>$uid,
 
"NAME" => $this->input->post("name"),
 
"LASTNAME" => $this->input->post("lastname")
 );
 
 
$query_profile $this->db->insert("user_profile"$profile);
 if(
$query_profile){
 return 
true;
 }else{
 return 
false;
 }
 }
 
 }
 
 } 
Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined variable: uid

Filename: models/model_register.php

Line Number: 31

Backtrace:

File: D:\AppServ\www\bilbo_ci\application\models\model_register.php
Line: 31
Function: _error_handler

File: D:\AppServ\www\bilbo_ci\application\controllers\page.php
Line: 47
Function: save

File: D:\AppServ\www\bilbo_ci\index.php
Line: 292
Function: require_once
Reply


Messages In This Thread
need help Message: Undefined variable - by setthawuth - 05-17-2015, 08:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB