Need PHP Help ! ( Mysql - Reward $ )

Discussion in 'PHP' started by MatriXica, Jul 5, 2008.

  1. #1
    hi allz..
    i do have a problem when i want to move my website to an new webhost
    i am using php nuke and i get an error when i try to put the backup from the curently php nuke database.


    # Table structure for table 'nuke_cpg_pictures'
    #

    CREATE TABLE nuke_cpg_pictures (
    pid int(11) NOT NULL auto_increment,
    aid int(11) DEFAULT '0' NOT NULL,
    filepath varchar(255) NOT NULL,
    filename varchar(255) NOT NULL,
    filesize int(11) DEFAULT '0' NOT NULL,
    total_filesize int(11) DEFAULT '0' NOT NULL,
    pwidth smallint(6) DEFAULT '0' NOT NULL,
    pheight smallint(6) DEFAULT '0' NOT NULL,
    hits int(10) DEFAULT '0' NOT NULL,
    mtime timestamp DEFAULT 'CURRENT_TIMESTAMP' NOT NULL,
    ctime int(11) DEFAULT '0' NOT NULL,
    owner_id int(11) DEFAULT '0' NOT NULL,
    owner_name varchar(40) NOT NULL,
    pic_rating int(11) DEFAULT '0' NOT NULL,
    votes int(11) DEFAULT '0' NOT NULL,
    title varchar(255) NOT NULL,
    caption text NOT NULL,
    keywords varchar(255) NOT NULL,
    approved enum('YES','NO') DEFAULT 'NO' NOT NULL,
    user1 varchar(255) NOT NULL,
    user2 varchar(255) NOT NULL,
    user3 varchar(255) NOT NULL,
    user4 varchar(255) NOT NULL,
    url_prefix tinyint(4) DEFAULT '0' NOT NULL,
    randpos int(11) DEFAULT '0' NOT NULL,
    pic_raw_ip tinytext,
    pic_hdr_ip tinytext,
    PRIMARY KEY (pid),
    KEY pic_hits (hits),
    KEY pic_rate (pic_rating),
    KEY aid_approved (aid, approved),
    KEY randpos (randpos),
    KEY pic_aid (aid),
    KEY search (title, caption, keywords, filename, user1, user2, user3, user4)
    );



    ERROR: #1170 - BLOB/TEXT column 'caption' used in key specification without a key length


    and if i try to delete from table "caption" it gives me another error :
    key max lenght 1000 char


    if think you can help me i will give you the infos of the host..so you maby can setup it for me..
    i will reward you with 5 $

    thanks and waiting your posts
     
    MatriXica, Jul 5, 2008 IP
  2. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    for error #1170:
    you need to set a length on caption in order to have it searched by key. such as text(1000) or something.

    as for deleting, i think this may resolve itself if a max langth is set on caption.
     
    X.Homer.X, Jul 5, 2008 IP
  3. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #3
    Try replacing:
    caption text NOT NULL,
    Code (markup):
    With
    caption varchar(255) NOT NULL,
    Code (markup):
    For a max length of 255 characters.

    Jay
     
    jayshah, Jul 6, 2008 IP
  4. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thats what i was saying up there. i just forgot to change text to varchar when i copied it. Im pretty sure if he was using text as the type he would want it a little more than 225 no? i dont know what he wants though.
     
    X.Homer.X, Jul 6, 2008 IP
  5. MatriXica

    MatriXica Active Member

    Messages:
    239
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #5
    i`m just trying to move the current mysql database from an webhost to antother webhost via import
    this i want to do.. and not working.. i get a couple of another errors..
     
    MatriXica, Jul 6, 2008 IP
  6. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #6
    Can you post them here?

    Thanks,
     
    jayshah, Jul 6, 2008 IP
  7. clarky_y2k3

    clarky_y2k3 Well-Known Member

    Messages:
    114
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    108
    #7
    A quick solution for now is to change this:
    
    KEY search (title, caption, keywords, filename, user1, user2, user3, user4)
    
    Code (markup):
    To this:
    
    KEY search (title, keywords, filename, user1, user2, user3, user4)
    
    Code (markup):
     
    clarky_y2k3, Jul 6, 2008 IP
  8. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #8
    I think your issue has been resolved. Do you still have any issue?
     
    mwasif, Jul 7, 2008 IP