Results 1 to 5 of 5

Thread: Help with mysql command text

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2014
    Posts
    52

    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

  2. #2
    Addicted Member
    Join Date
    Oct 2008
    Location
    Califorina
    Posts
    235

    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?

  3. #3
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    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

  4. #4

    Thread Starter
    Member
    Join Date
    Mar 2014
    Posts
    52

    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)

  5. #5

    Thread Starter
    Member
    Join Date
    Mar 2014
    Posts
    52

    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
  •  



Click Here to Expand Forum to Full Width