SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Only numbers, or letters as well?
    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.

  2. #2
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It depends - in PHP, it juggles the types for you. If you say this:


    $num = 4.0


    It'll convert it to a double, or a floating number (both terms are correct, I believe). I'm pretty sure that something like this:


    $num = "4a";


    Would be evaluted as "4".

    For example:


    $one = "4a";
    $two = "2";
    $total = $one + $two;
    // $total equals "6"


    However, if $one equals "a4", I believe it then has no numerical value for equestions such as the one given the name of $total.

  3. #3
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see... Thanks, Chris
    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.

  4. #4
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,289
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    If you're talking databases, then it's numbers only, though I do think depending on the type, it might construe some letters as the sign of the number....
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse

  5. #5
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Elledan
    I see... Thanks, Chris
    No problem - let me know if my syntax or reasoning is a bit off - I've actually just learned a few of those things in my last post within the last day or so, so I might be mistaken.

  6. #6
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You were right, Dave, I was indeed talking databases (mySQL db, to be precise), but I've now just used 1,2,3 etc. for the integer (first column) and the libraryID/projectID which I'll have to pass in the query-string is now in a fifth column.

    Chris, your syntax is fine and I believe your reasoning as well

    Thanks, both of your, for your most helpful replies
    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •