[help]School Project Here |
[eluser]miwrath[/eluser]
Hello im Mark, im a computer science student... i need help for the first Codeigniter project that i have to do... its a school project for my thesis... this is my first time to use CI. i made this thread to easy help me for my codings... i hope this section is the right one on this topic...
[eluser]miwrath[/eluser]
i have my first problem here: Quote:A Database Error Occurred i set my database by this message still cames out... need help pls... ![]()
[eluser]Bart v B[/eluser]
Did you load the session class? Did you try it direct in the database?
[eluser]davidbehler[/eluser]
This simply means there's no column called session_id in your users table. You should set up your sessins table like described in the User Guide and fix your settings, apparently you've set the name of your session table to 'users'. Update config/config.php and change the value for '$config['sess_table_name']' to 'ci_sessions'.
[eluser]miwrath[/eluser]
so it means...i have to create 'session_id' in my 'users' table in database? and put it back again the 'ci_sessions' in ‘$config[‘sess_table_name’]’????
[eluser]davidbehler[/eluser]
Why is your sessions table called 'users'? Users are not the same as sessions.
[eluser]miwrath[/eluser]
i got it sir..."users" is my table name... here is my next problem... hoooooooooo...this is going to be tough... thank you so much Mr.waldmeister for your help... Quote:A PHP Error was encountered
[eluser]davidbehler[/eluser]
I'll keep repeating myself till you get it right : Just use the table definition that's provided in the User Guide instead of manually adding every column the session library needs to your users table. Those 'undefined variable: .." errors mean you are trying to access a variable that does not exist (yet). But without seeing some of your code it's pretty hard to tell what's going wrong. Have you ever coded with PHP before? It's essential that you know PHP if you want to use CI! It's just a framework that makes it easier to set up and build your projects, but it doesn't remove the need of knowing how to code in the first place!
[eluser]miwrath[/eluser]
im so sorry Mr. waldmeister im just beginning my journey to learn deeply the PHP... im just a self study kid... huhuhu user_model.php in my models folder. Code: <?php view file "view_registrar" in my views folder. Code: <html> hope this will clear up things...
[eluser]davidbehler[/eluser]
Don't call me Mr...I'm not that old ![]() But anyway, let's fix your problems: Change your function defintion slightly: Code: function check_login($username, $password) Either fully build your query string and then run it: Code: $query_str = "SELECT * FROM users WHERE username = '$username' and password = '$password'"; Code: $query_str = "SELECT * FROM users WHERE username = ? and password = ?"; Code: $this->db->where('username', $username); |
Welcome Guest, Not a member yet? Register Sign In |