The Ace Posted April 8, 2008 Share Posted April 8, 2008 I am trying to delete a row from my database. I have tried SO many things to delete this row from my users table, but I keep getting this error: Error SQL query: DELETE FROM users WHERE Field = 'bankcrystal2' MySQL said: Documentation #1054 - Unknown column 'Field' in 'where clause' Do I need to add ' to users, like 'users' I am using http://www.w3schools.com/sql/sql_delete.asp to help, but I can't seem to get it to delete...any help you can give me? I am trying to do things myself to learn, but I just can't seem to delete it... :( Quote Link to comment Share on other sites More sharing options...
Spudinski Posted April 8, 2008 Share Posted April 8, 2008 Re: SQL Queries Do you want to delete the bankcrystal2 column in the users table? If so, use this query: ALTER TABLE `users` FRP `bankcrystal2` Link: http://www.w3schools.com/sql/sql_drop.asp If not, please explain a bit more on what you want ot delete. Quote Link to comment Share on other sites More sharing options...
The Ace Posted April 8, 2008 Author Share Posted April 8, 2008 Re: SQL Queries Uh...no, not really. In my users table, I have userid, etc, then bankcrystal2. But I have a crystalbank2 which I use, but I don't use bankcrystal2. And I want to delete that field from the users table. Would the query be: ALTER TABLE `users` DROP INDEX `bankcrystal2` Quote Link to comment Share on other sites More sharing options...
Spudinski Posted April 8, 2008 Share Posted April 8, 2008 Re: SQL Queries Yes, that would do it. Quote Link to comment Share on other sites More sharing options...
The Ace Posted April 8, 2008 Author Share Posted April 8, 2008 Re: SQL Queries Humph...bugger: SQL query: ALTER TABLE `users` DROP INDEX `bankcrystal2` MySQL said: Documentation #1091 - Can't DROP 'bankcrystal2'; check that column/key exists Quote Link to comment Share on other sites More sharing options...
Spudinski Posted April 8, 2008 Share Posted April 8, 2008 Re: SQL Queries Oh, try it without the INDEX in the query, aslo check that the names are spelled correctly. Quote Link to comment Share on other sites More sharing options...
The Ace Posted April 8, 2008 Author Share Posted April 8, 2008 Re: SQL Queries ALTER TABLE `users` DROP `bankcrystal2` worked! :) Thanks a lot Spudinski! :D Highly appreciated... Quote Link to comment 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.