1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Error 1264 Mysql

Discussion in 'Databases' started by Pervade, Jan 31, 2021.

  1. #1
    The following error appears only for one user member, registered in my site as below:

    1264 error out of range value column timeonline row 1
    
    UPDATE No11GGUsers SET lastactive=1612022704
    Timeonline+timeonline +24 where uid 206
    Code (markup):
    I'm not an SQL expert but I can make the necessary changes in that user table and use available boxes options. Such us changing the value type to int, charvar, ...etc

    So what i need to do to stop this error showing up in my website?
     
    Last edited: Feb 1, 2021
    Pervade, Jan 31, 2021 IP
  2. Efetobor Agbontaen

    Efetobor Agbontaen Active Member

    Messages:
    136
    Likes Received:
    41
    Best Answers:
    5
    Trophy Points:
    85
    #2
    When asking for MYSQL/SQL Help, it's always advisable to provide people with your table definition (Each Column and it's datatype).

    From the error, I would guess datatype for 'lastactive' is int. And 1612022704 is too large for an int datatype.

    So try to change the datatype of lastactive to varchar.
     
    Efetobor Agbontaen, Jan 31, 2021 IP
  3. Pervade

    Pervade Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Timeonline column has INT 10 datatype.
    Lastactive column has INT 10 datatype too.

    Also as i say im NOT a sql expert.I need exactly what i must do.For example when i changed INT to Charvar via boxes options i receive other syntax errors.So you must tell me exactly what i must do.

    Like this: Choose charvar option,then set value 0,then choose unsigned value like this i want you to guide me.
     
    Pervade, Jan 31, 2021 IP
  4. JEET

    JEET Notable Member

    Messages:
    3,825
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #4
    Try changing it to "bigint" type, with 18 length.

    You can do this with a query
    Alter table No11GGUsers MODIFY Timeonline BIGINT(18);
    Alter table No11GGUsers MODIFY Lastactive BIGINT(18);

    You can copy paste those queries in your phpmyadmin.
    But if the table is too large, then do not use phpmyadmin.
    In that case, put the query in a .sql file and run via shell.
    or run via php script which has set_time_limit(0) execution timelimit.
     
    JEET, Feb 5, 2021 IP
  5. Pervade

    Pervade Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #5
    Thanks for that.But i deleted that table already,i wish you had replied earlier.But thanks
     
    Pervade, Feb 7, 2021 IP
  6. jhonalbert

    jhonalbert Greenhorn

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    13
    #6
    To fix the error, change your datatype to VARCHAR. Phone and Fax numbers should be stored as strings.
     
    jhonalbert, Apr 14, 2022 IP
  7. mmerlinn

    mmerlinn Prominent Member

    Messages:
    3,197
    Likes Received:
    818
    Best Answers:
    7
    Trophy Points:
    320
    #7
    Any "number" like phone numbers, ID numbers, house numbers, bank numbers, post codes, and so on should ALWAYS be stored as strings. The ONLY numbers that should be stored as integers, etc are those numbers that are used in MATHEMATICAL operations.
     
    mmerlinn, Apr 14, 2022 IP
    Efetobor Agbontaen and JEET like this.