littlevisuals Posted July 25, 2009 Share Posted July 25, 2009 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... Quote Link to comment https://forums.phpfreaks.com/topic/167418-solved-does-mysql-automatically-know-the-tables-in-a-database/ Share on other sites More sharing options...
littlevisuals Posted July 25, 2009 Author Share Posted July 25, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/167418-solved-does-mysql-automatically-know-the-tables-in-a-database/#findComment-882815 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.