Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorIneX
    • CommentTimeDec 4th 2007 edited
     
    In my booklink tutorial app, I added a new row "isbn13" to the books table. First, this was a int(), which supports up to 10 characters only (isbn13 consists of 13 characters). As soon as I got rid of this mistake, I changed it to the next bigger integer-type: bigint(), which supports up to 19 characters.

    Now I edited a book and wanted to correct the previously added isbn13-number, but it did't save this value as a 13-character long bigint. There was another, shorter number, added to the database.

    In the end, I changed the isbn-table row to varchar(13) and, magically, my isbn13 codes were saved correctly.

    My question: why didn't bigint() save the isbn-number? I did not write any special chars, just numbers. I checked the mysql-database with an administrative tool, it stated correctly "bigint" as the isbn13's row type there.

    Well, I could fix this issue by changing to varchar(), but I would really like to know what could be the problem concerning this isse. Any ideas?
    • CommentAuthorKaste
    • CommentTimeDec 4th 2007 edited
     

    two comments.

    first, i would say isbn13 isn't a number, it's a string because you can't multiply two isbn's.

    second, right now we type cast int's as integer's. so this applies.

    this was a int(), which supports up to 10 characters only

    had a wrong implication, because

    9876543210 'has' 10-characters, though it is not an integer.

    • CommentAuthorIneX
    • CommentTimeDec 5th 2007 edited
     

    first, i would say isbn13 isn't a number, it's a string because you can't multiply two isbn's.

    Right.

    we type cast int's as integer's

    I don't really understand this, sorry. I agree with your above statement, that ISBN-13 should be treated as string. But how would I handle it, if there would be a "real" bigint() in my mysql-table and I want to use it in my Akelos App?

    • CommentAuthorKaste
    • CommentTimeDec 6th 2007
     

    how did you do this before Akelos?

    • CommentAuthorKaste
    • CommentTimeDec 6th 2007
     

    we type cast int's as integer's

    should be

    we type cast int's as php-integer's

Add your comments
    Username Password
  • Format comments as