WesleyA Posted June 7, 2015 Share Posted June 7, 2015 Unknown column 'col' in 'field list' Is the error message, i tried all kinds of backticks, and quotes but doesnt work So I was thinking, how can I check (in phpmyadmin or in the mysql console) whether a table has the columns that are needed? Link to comment Share on other sites More sharing options...
Ingolme Posted June 7, 2015 Share Posted June 7, 2015 What does your query look like? I would assume you're supposed to know the structure of the database tables you're querying. Link to comment Share on other sites More sharing options...
WesleyA Posted June 7, 2015 Author Share Posted June 7, 2015 $sql = "INSERT INTO camping (linkname, addlink) VALUES ('camping Fantasia' , 'http://www.campingfantasia.com')"; I dont see any column like linkname or addlink in phpmyadmin. How can I check whether this exists or not? Link to comment Share on other sites More sharing options...
dsonesuk Posted June 7, 2015 Share Posted June 7, 2015 If they do not show in table camping, then that is the problem, they have to exist to insert into. Link to comment Share on other sites More sharing options...
WesleyA Posted June 8, 2015 Author Share Posted June 8, 2015 Is it possible to create a table without columns? Link to comment Share on other sites More sharing options...
dsonesuk Posted June 8, 2015 Share Posted June 8, 2015 Well yes! It seems you just proved that, but again you would not be able to insert info into it. Link to comment Share on other sites More sharing options...
WesleyA Posted June 8, 2015 Author Share Posted June 8, 2015 OK but I actually mean a column heading. What I look for is a query to create a column heading and a row heading. Is there any? Link to comment Share on other sites More sharing options...
dsonesuk Posted June 8, 2015 Share Posted June 8, 2015 With column heading it is as if you are adding new field name, you can do this using ALTER seehttp://www.w3schools.com/sql/sql_alter.aspThe row is individual records that hold details relating to the column heading.You can only add heading once only with alter unless you use unique column heading each time, which would not be a practical way of creating table. Link to comment Share on other sites More sharing options...
WesleyA Posted June 8, 2015 Author Share Posted June 8, 2015 actually it worked, I added the values to the wrong table. Link to comment Share on other sites More sharing options...
dsonesuk Posted June 8, 2015 Share Posted June 8, 2015 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now