Mysql Help

Discussion in 'Programming' started by Internal09, Feb 2, 2013.

  1. #1
    When I delete threads in my vbulletin forum it gives me the error below.

    Invalid SQL:
    
                 DELETE searchcore, searchcore_text
                FROM searchcore AS searchcore JOIN
                    searchcore_text AS searchcore_text ON
                        searchcore.searchcoreid = searchcore_text.searchcoreid
                WHERE searchcore.groupcontenttypeid = 2 AND
                    searchcore.groupid = 942;
    Code (markup):
    How can I fix this issue.
     
    Internal09, Feb 2, 2013 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    DELETE FROM tablename WHERE conditions

    You're trying to delete specific fields in the records - that's invalid. You can only delete whole records.
     
    Rukbat, Feb 4, 2013 IP
  3. Alex Roxon

    Alex Roxon Active Member

    Messages:
    424
    Likes Received:
    11
    Best Answers:
    7
    Trophy Points:
    80
    #3
    Do you want to delete those columns, or set the values of the columns to empty?
     
    Alex Roxon, Feb 4, 2013 IP
  4. alamlinks

    alamlinks Well-Known Member

    Messages:
    992
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    140
    #4
    Deleting data from table :
    delete from <table name> - will delete all the record from table
    Delete from <table name> where <condition> - will deleted some record following the condition

    Deleting/add column from/to a table
    ALTER TABLE <table_name> ADD <column_name> datatype - will add new columnn to the table
    ALTER TABLE <table_name> DROP COLUMN <column_name> - will delete the column from the table

    Deleting table:
    DROP TABLE <table_name> - will delete the table with all values

    Deleting database:
    DROP DATABASE <database_name> - will delete the database with all tables

    Best of Luck



    ----
     
    alamlinks, Feb 5, 2013 IP