SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Vancouver, B.C., Canada
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Data type text issue

    Hi,

    I have a php/sql script that inserts text into a database. I have a field with datatype text. It seems the script only inserts text into the database if it is under a certain number of characters. I don't know how this is so as the limit on the text data type is 65 535 characters. The input field of the form has a maxlength of 300. Any ideas why this might be happening? Thanks.

  2. #2
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    are you using ODBC? i seem to remember someone saying that ODBC has a 255 character limit for any one field.
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Vancouver, B.C., Canada
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hrmm... that wouldn't be the issue. I can enter more than 255 characters.

  4. #4
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    ok, enough beating around the bush.

    what type of SQL server?

    what library are you using in PHP?

    at what exact length do your inserts fail?
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast

  5. #5
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Vancouver, B.C., Canada
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is the info www.softrak.com/info.php

    Ok it can't be a character limit.

    I can add this (960 characters):

    PHP Code:
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest 
    But can't add this:

    PHP Code:
    Vast Experience with Not-for-profit OrganizationsFirst Nation BandsTribal Councils and related entititesService Industries and Resorts/HotelsKen AberdeenCMA has worked extensively for over 20 years in Governmentthe Accommodations and Golf IndustriesFirst Nations Band Management and For-Profit businessThe focus at Aberdeen Business Consulting is to help you "Optimize your organization's financial management." Customized Finiancial Statements using Adagio FX and the Ledger's Financial Reporter - G/L Restructuring and Design - Training and Remote Support - PayDirt Payroll Specialist 

  6. #6
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    i think the problem is more likely that you're not properly escaping your data, and you're also not doing proper error checking.
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast

  7. #7
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,014
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    you're right, it isn't a character limit

    it's actually a syntax error, caused by the embedded single quote, which, as longneck said, needs to be escaped
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  8. #8
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Vancouver, B.C., Canada
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought I had tested for that but I've just noticed magic_quotes_gpc is set to off. So that would seem to be the error.

    Much appreciated guys.


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
  •