WEB MySQL whitespaces

Discussion in 'OT Technology' started by hurleyint1386, Nov 12, 2007.

  1. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    It's been a while since I've done this, so I can't really remember. If I want to echo a record from a database, and the record includes white space (i.e. 'Rochester, NY'), how do I prevent it from echoing 'Rochester,' ? I'm sure it something simple, but I can't remember. Thanks
     
  2. Insert Tokens

    Insert Tokens Making Cancer My Bitch OT Supporter

    Joined:
    Jan 12, 2006
    Messages:
    8,315
    Likes Received:
    70
    Location:
    Tasmania
    $data = "whatever you want";
    $data_array = explode(" ", $data);
    echo $data_array[0]; // Returns: whatever
    echo $data_array[1]; // Returns: you
    echo $data_array[2]; // Returns: want
     
  3. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    haha actually i was an idiot. i checked the source, and it was all in there, however the field had " value=Rochester, NY " instead of being " value='Rochester, NY'"

    quotes owned me :rofl:
     

Share This Page