Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issues with PHP and MS SQL

Status
Not open for further replies.

carlg

Programmer
Jun 23, 2004
88
US
I am using Microsoft SQL and PHP.

I have the following code



$sql = "SELECT j.Title AS title, j.JobType AS type, j.Location AS location, j.Requirements AS requirements,
j.SpecialRequirements AS special, j.Background AS background, CONVERT(TEXT,j.Description) AS description,
c.CategoryName AS category, c.JobCategoryID AS category_id
FROM tbJob j
INNER JOIN tbJobCategory c ON j.JobCategoryID = c.JobCategoryID
WHERE JobID = " . $job_id;
$result = $job_db->getRow($sql, DB_FETCHMODE_ASSOC);
print $result['requirements'];



The requirements field is a char(1000) in the database. When I select the row with query analyzer, it looks fine. So the data is stored in the DB properly.

When I print out requirements after the fetch, it gets truncated. Only the first 200 or 300 bytes display. The end of the string is kinda chopped off. Where should I start looking to debug this?

Any help is appreciated

Thanks
Carl
 
Think I fixed the problem

Thanks

I changed the definition of the database field from char(1000) to text.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top