Database behavior ***** Cant Understand *****

#1
[eluser]sbarow[/eluser]
Hi,

I am experiencing some very strange behavior, I am using CI's database class to get information from a MySQL database, everything loads fine, but if I add a new table or column to any table CI tells me that the table or column does not exist.

To break it down, I have a table called Info with columns home, about, products, services, if I use
Code:
$this->db->select('home');
$this->db->get('Info');
then everything works fine but if I then go into phpMyAdmin and insert a new column say "test" and then use the about query replacing "home" with "test" it tells me the column does now exist.

The same happens if I create a new table, it returns with the error that the table does not exist. Can anyone explain this and advise a possible fix?

Pretty damn frustrating.

#2
[eluser]apobukay[/eluser]
maybe your column "home" has white space or space in your database
check it

#3
[eluser]sbarow[/eluser]
How I wish it was something as simple as that, let me explain again any new tables or columns I add to my database are not recognized my the site. Meaning If I add a new column or table, I get an error saying that it does not exist!

#4
[eluser]sbarow[/eluser]
Seems the database I have been connecting to is the back up database, so it has not updated with all the new info. Explains why it was saying that things do not exist.

#5
[eluser]apobukay[/eluser]
maybe you have a two database with a similar table.. maybe you are adding a table and column to different database or.. check your configuration in system/config/database.php

#6
[eluser]sbarow[/eluser]
What was happening is that in my config I set the connect to connect to my back up mysql server, which had not backed up the new data yet, hence the errors. All is solved thanks.

#7
[eluser]apobukay[/eluser]
"Seems the database I have been connecting to is the back up database, so it has not updated with all the new info. Explains why it was saying that things do not exist."

check your database in phpmyadmin and look for your table you're trying to get is existing..

#8
[eluser]sbarow[/eluser]
Do you read my posts?

I solved the problem thanks, like I said I was connecting to my back up database which has not backed up yet, now that I am connecting to my normal database i.e NOT the back up everything is working. *Mix up with the IP addresses*


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.