-
Apr 15th, 2014, 11:44 AM
#1
Thread Starter
Member
Help with mysql command text
Hi i trying to make that mysql column delete but it seems there is an error :| WHERE!!
Code:
cmd.CommandText = "ALTER TABLE 'buildings' DROP '" & Form1.PlayerName & "' WHERE ID = 1"
dr = cmd.ExecuteReader
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''buildings' DROP 'ign__' WHERE ID = 1' at line 1
The colum exist
-
Apr 15th, 2014, 11:55 AM
#2
Addicted Member
Re: Help with mysql command text
Do you want to delete the record where it meets your criteria or are you trying to alter the database schema?
-
Apr 15th, 2014, 11:56 AM
#3
Re: Help with mysql command text
What exactly are you trying to do? do you want to delete the table or one column or just the first record?
if you want to delete a column you should not use a WHERE clause as the column affects all records.
If you want to delete the table, just use the DROP without any other consideration
If you want to delete the contents of a field in one row then UPDATE and SET
If you want to delete a record I believe the syntax for that would be
Code:
DELETE FROM buildings WHERE ID=1
More important than the will to succeed, is the will to prepare for success.
Please rate the posts, your comments are the fuel to keep helping people
-
Apr 15th, 2014, 12:00 PM
#4
Thread Starter
Member
Re: Help with mysql command text
i need to delete column(or how they are called) where name is form1.playername and id = 1 (not 2 not 3 but 1)
-
Apr 15th, 2014, 12:01 PM
#5
Thread Starter
Member
Re: Help with mysql command text
Thanks worked
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|