Jump to content

[SOLVED] Does mySQL automatically know the tables in a database?


littlevisuals

Recommended Posts

Hi everyone,

 

Just a quick question if I may, I have a db 'DATA' and 6 or so tables named 'DATA' 'cat' 'images' 'user_id' .

 

Now ive made a form which inserts information fine in 'DATA' when I use

 

 include("../connect.php");
   mysql_connect("localhost","root","password");
   mysql_select_db("DATA");

 

Now im trying to insert data on other tables 'cat' for example and use the same query but does mySQL go through all the tables looking for that field in a db, or because I have a table called the same as the db 'DATA'

it finds that but not 'cat'

 

My other question is in my above code do I need to select_db and a table, if so any ideas as how I could?

 

Many thanks  ::)

 

 

edit: the main error I get is Unknown column 'location' in 'field list', which is clearly located in a table...

::)  Found the issue

 

my code connected to the database, but selecting the table is done when inserting the data using the query

 

 $query = "INSERT INTO DATA 

 

to

 

 $query = "INSERT INTO cat 

 

Maybe I was too quick to jump to the forum  :P

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.