Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 23:55

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



failure displaying error msg

Discussion on failure displaying error msg within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2013
Posts: 5
Received Thanks: 0
failure displaying error msg

My problem are:
i.when i run the system statement 'USER ALREADY EXIST' not displayed when i try to register user with the same no_staf (staff number) which exist in database.

ii. registration with the same no_staf does not go through which mean, the code prevent re-registration of existing user but not sure why above statement not displayed

hope somebody can correct me.
Code:
public function daftar()//register new account/user
	{
		$this->load->view('view-daftar-akaun'); //view register account
	}
	
	public function daftar_akaun()//register account
	
	{
	
		$query = $this->modeluser->ciptaAkaun();//create account
		
		
		$this->session->set_flashdata('mesej', '<span class="label label-info">Akaun telah berjaya dicipta!</span> ');
		redirect(base_url().'admin/daftar'); 
	}
model

Code:
class ModelUser extends CI_Model {
	
	public function ciptaAkaun()
	{
		
		$namaStaf 	= 	$_POST['nama_staf'];//staff name
		$noStaf		= 	$_POST['no_staf'];// staff number
		$email 		= 	$_POST['email'];
		$kataLaluan =	sha1($_POST['kata_laluan']);
		$jenis 		= 	0;	// user is 0 - admin is 1
		$jawatan	=	$_POST['jawatan'];
		
							if ($this->checkUserExist($noStaf ) == false)
            return 'USER ALREADY EXIST';
			 
	 $this->db->query("INSERT INTO akaun (nama_staf,no_staf,email,kata_laluan,jenis,jawatan) VALUES ('$namaStaf','$noStaf','$email','$kataLaluan','$jenis','$jawatan')");
    }

 private function checkUserExist($noStaf )

  {
     $this->db->where('no_staf', $noStaf );
     $query = $this->db->get('akaun');
     if( $query->num_rows() == 0 ){ return TRUE; } else { return FALSE; }
  }
Ranyhoss72 is offline  
Reply


Similar Threads Similar Threads
[help me] Connection failure error
04/15/2013 - League of Legends - 2 Replies
Hi, yesterday, after i finished a game, my LoL Cleint got crashed. Until then I can't log in on any account. I have tried turning off my firewall/antivirus, adding lol launcher to trusted programmes, reistalling the game, restarting my router. The worst thing is that it doesn't work on any computer in my house, so it can't be problem with this pc. I hope you guys can find a solution, since LoL Support can only send me to another article with useless "guides". regards,
LastChaos Odiseum failure server with failure rules
12/30/2012 - Last Chaos Private Server - 2 Replies
My account got hacked and item stoolen and cash items . the staff say its my responsibily about that , really ? , do i ask people to hack my account so be my responsibility ? and what kind of server put rules after 2 weeks of release server ? SHOULD RELEASE IT when the server start . this the worest server i played i dont know i felt this good server but what happen with wasted cash ? ............ and all im saying is from my heart and the anger im in now ,,,,,,
[How²] Bot Failure Error vermeiden
03/15/2012 - Metin2 Guides & Templates - 84 Replies
http://www.bilderload.com/daten/boterrorEMA2E.jpg Vorwort: Dieses HowTo dient dazu, euch zu zeigen wie ihr mit einem Freund oder einer Gruppe von Leuten, denen ihr vertraut eure Easymetin2 Accountdaten teilen könnt und alle gemeinsam nur einen Account zahlen müsst und nutzen könnt, ohne dass der Bot Failure bei jedem ständig kommt! Ich habe versucht euch die Einrichtung so einfach wie möglich zu machen also los gehts: Zunächst mal öffnen wir den Explorer (völlig egal ob Arbeitsplatz,...
GameGuard update failure. Error code 340, 350, 361, 380
08/29/2010 - Wolfteam - 13 Replies
Hallo.Wenn ich Wolfteam starte .steht da der error code und ich werde auf die Seite von GamuGuard versetzt.Was ist das ??Eas soll ich machen ?Das ist der Link:http://www.gameguard.co.kr/gameguard/faq/eng/ FAQ_3xx.htm



All times are GMT +1. The time now is 23:55.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.