String getting chopped up

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bill

    String getting chopped up

    I'm submitting a string of data, with several words in it. When I try
    to retreive it from the database, I'm finding the words of the string
    have been removed. For example, if the string entered is a person's
    title, such as Vice President of Finance, it is only showing
    VicePresident
    then nothing else is showing. What could be the problem?

    Thanks,

    Bill
  • Albert Ahtenberg

    #2
    Re: String getting chopped up

    Hi,

    What is the type of the field in the DB where the string is stored? Maybe it
    is too short so the DB truncates it.

    Albert Ahtenberg


    Comment

    • Bill

      #3
      Re: String getting chopped up

      > What is the type of the field in the DB where the string is stored?

      Albert, in answer to your question, the field is a varchar 100 so I
      know that's not what's happening. I have a feeling there is something
      to do with of of the fields not being surrounded by quotations, but I
      can't figure out which one. It seems to happen whereever there is a
      space between words. So if I have VicePresident it will work, but if I
      have Vice President, two words, it will show Vice, but then it won't
      show the rest of the string. What could this be?

      Thanks,

      Bill

      Comment

      • Andy Hassall

        #4
        Re: String getting chopped up

        On 16 Jul 2003 17:41:07 -0700, billzimmerman@g ospellight.com (Bill) wrote:
        [color=blue]
        >I'm submitting a string of data, with several words in it. When I try
        >to retreive it from the database, I'm finding the words of the string
        >have been removed. For example, if the string entered is a person's
        >title, such as Vice President of Finance, it is only showing
        >VicePresiden t
        >then nothing else is showing. What could be the problem?[/color]

        Not enough information to say.

        Post a (short!) sample of code that demonstrates the problem.

        --
        Andy Hassall (andy@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk)
        Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)

        Comment

        • Shawn Wilson

          #5
          Re: String getting chopped up

          Bill wrote:
          [color=blue]
          > I'm submitting a string of data, with several words in it. When I try
          > to retreive it from the database, I'm finding the words of the string
          > have been removed. For example, if the string entered is a person's
          > title, such as Vice President of Finance, it is only showing
          > VicePresident
          > then nothing else is showing. What could be the problem?[/color]

          Often when this happens, it's because quotes are left out of the form.

          ie.
          <input name = position value = <?PHP echo ($_GET['position']); ?> >

          I'd check that first. If not, post a code snippet.

          Shawn
          --
          Shawn Wilson
          shawn@glassgian t.com



          Comment

          Working...