Welcome Guest, Not a member yet? Register   Sign In
Error database
#1

Hey everyone, 

I'm pass for a strange situation,

I'm developing a web system and in my localhost works fine, but I just put the site in the cloud,
So I fix the database infos, and all my model class, to first letter UPPER, but when I will login on system, sometimes works fine, but some times get an error, that I will post a image of error and my source code, is that, sometimes works login some times no, I searched a lot and can fix Sad

Anyone can help?

Attached Files Thumbnail(s)
       
Reply
#2

@osvaldobnu,

It would be nice to see your model. My first question is what value is expected to be returned by the model? What happens if the result set of the query is empty or null (in the model)?
Reply
#3

(This post was last modified: 02-05-2020, 07:28 AM by osvaldobnu.)

(02-05-2020, 07:15 AM)php_rocs Wrote: @osvaldobnu,

It would be nice to see your model.  My first question is what value is expected to be returned by the model?  What happens if the result set of the query is empty or null (in the model)?

Hey, I upload the model now,
And answer your question about what returns, returns null, but the user exist on database.

Thanks in advance.

Attached Files Thumbnail(s)
   

.php   Model_usuario.php (Size: 3.74 KB / Downloads: 3)
Reply
#4

Hi,

Apparently there is no user in your DB. This is the only possible option. To confirm that (if you do not trust your code), take the SQL constructed by CI Query Builder and execute it directly in the DB (using command line mysql, or using PHPMyAdmin or similar tool) to visualize the result:

SELECT * FROM usuarios WHERE login=$login AND senha = $senha LIMIT 1

Obvioudly you have to know values for $senha and $login.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB