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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

string length trouble

Status
Not open for further replies.

bigdan

Technical User
Nov 13, 2000
41
CA
I'm accessing a DB(MSaccess) with php and I have a string that is truncated!!!

It seem to be trunc to 4095 character because if I do this
echo strlen($desc); it return 4095.

How I can store the content of a field that have large amount of text and display it in html page???

Thanks

Dan

Here's my code.

<?php

$t1=$_REQUEST['T1'];

$sql="SELECT [contenu].page, [contenu].Sujet, [contenu].Description, [contenu].iden, [contenu].count, [contenu].lastvisit FROM [contenu] WHERE [contenu].iden =" . $t1;

$conn=odbc_connect('intranetcgr','','');
if (!$conn)
{exit("Connection Failed: " . $conn);};

$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
if (odbc_fetch_row($rs))
{
$page=odbc_result($rs,"page");
$sujet=odbc_result($rs,"sujet");
$desc=odbc_result($rs,"description");
echo "<strong><big>";
echo $page;
echo "</strong></big><br><br>";
echo "<strong>$sujet</strong><br><br>";

echo strlen($desc);

echo $desc;
while (odbc_fetch_row($rs))
{
$date=odbc_result($rs,"date");
$date=substr($date,0,10);
$statut=odbc_result($rs,"archive");
$iden=odbc_result($rs,"iden");

}

odbc_close($conn);

}

else {

echo "Tu me cherche Hein!!!!<br>";
echo "Attention tu vas me trouver!!!";

}

?>
 
In french it is call "MEMO"
I think that in english it is call Textarea instead of regular text field.

Thanks

Dan
 
non - en fait je parle du nom de type de champ dans MS Access lui-meme, pas l'element HTML. En anglais le champ s'appelle Memo aussi. ca veut dire que les contenus ne sont limite que par le OS

je me souviens qu'il existe des limitations dans le pilote ODBC que donnent des problemes avec des champs longues.

Pour le requidre, je crois qu'il y a un directif odbc qui tu peut tenter
Code:
odbc_longreadlen($cur, 10000); //change le numero a volontier

mets cette ligne avant les odbc_result
 
Je vais essayer.

Par contre cela fonctionne bien en asp.
Car je transfere présentement notre intranet de ASP a PHP.

Pour ce qui est du nom du type de champs dans access c'est belle et bien "MEMO"
Demain au bureau je vais revérifier.

Merci

PS de qu'elle région est tu pour parler francais ;)))
Moi je viens de la région de Montreal (canada)

Dan
 
Merci cela fonctionne très bien

Dan
 
avec plaisir!

a mon part je suis un anglais a Toulouse. Un bel paysage avec un accent super bizarre. ici on mange du paing dans le mataing...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top