Salut a tous,
Voila mon soucis:
je fais une requête sql pour recuperer des données (pas de soucis)
ensuite je veux les afficher mais pour un des champs, il me pose un probleme:

voici le code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<?
require_once($GLOBALS[DOCUMENT_ROOT]."/inc/global.inc.php");         //  les classes
require_once($GLOBALS[DOCUMENT_ROOT]."/inc/session_club.inc.php");   // la session
?>
<table border="0" cellspacing="0" cellpadding="0" >
	<tr>
    	<td ><a href="/news/index.php"><img border="0" src="/new_charte/images/index/fildinfos_03.gif" ></a></td>
        	<td style="background-image:url(/new_charte/images/index/fildinfos_04.gif);background-repeat: repeat-x;font-family:Arial, Helvetica, sans-serif; font-size:12px;" valign="middle">
			</td>
			<td  width="17"><img src="/new_charte/images/index/fildinfos_06.gif" border="0">
			</td>
		</td>
	</tr>
</table>
<script language="JavaScript1.2">
// Les variables de style à changer :
var scrollerwidth='180px' // Largeur
var scrollerheight='210px' // Hauteur
var scrollerbgcolor='#f6f5fd' // Couleur de fond
var scrollerbackground='' // L'image de fond,
var scrollertime='2000' // temps d'attente entre chaque info
<?
mysql_select_db($database_CONN_MAB, $connexion);
$query_news = "SELECT NEWS_ARTICLE.*, NEWS_RUBRIQUE.RUBRIQUE FROM NEWS_ARTICLE, NEWS_RUBRIQUE WHERE NEWS_ARTICLE.ID_RUBRIQUE=NEWS_RUBRIQUE.ID_RUBRIQUE and ETAT='V' and (NEWS_ARTICLE.LANGUAGE='".$_SESSION['site_language']."' or NEWS_ARTICLE.LANGUAGE='INT') ORDER BY DATE DESC, HEURE DESC limit 0,10";
$news = mysql_query($query_news, $connexion) or die(mysql_error());
$row_news = mysql_fetch_assoc($news);
$totalRows_news = mysql_num_rows($news);
$i=0;
while ($row_news = mysql_fetch_assoc($news))
{
	$ppp = "SELECT customers_login from osc_customers where customers_id=".$row_news['ID_PERSONNE'];
	$pp = mysql_fetch_assoc(mysql_query($ppp, $connexion));
	$string[$i]=$row_news['TEXTE'];
	
	
	$messages[$i]="<a href=/news/archives_". $row_news['SEMAINE'] .".htm#". $row_news['ID_NEWS'] .">". $row_news['TITRE'] ."</a><br /><div align=right> par ".$pp[customers_login]."</div><br />".substr($string[$i],0,20);//lorsque je rajoute cela, j'ai plus rien
	
	$i=$i+1;
} 
echo "var messages = new Array(\"" . implode("\",\"", $messages) . "\");";

?>

// Ne plus rien changer dessous
var ie=document.all
var dom=document.getElementById
if (messages.length>2)
	i=2
else
	i=0



function move1(whichlayer)
{
	tlayer=eval(whichlayer)
	if (tlayer.top>0&&tlayer.top<=5)
	{
		tlayer.top=0
		setTimeout("move1(tlayer)",scrollertime)
		setTimeout("move2(document.main.document.second)",scrollertime)
		return
	}
	if (tlayer.top>=tlayer.document.height*-1)
	{
		tlayer.top-=5
		setTimeout("move1(tlayer)",50)
	}
	else
	{
		tlayer.top=parseInt(scrollerheight)
		tlayer.document.write(messages[i])
		tlayer.document.close()
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

function move2(whichlayer)
{
	tlayer2=eval(whichlayer)
	if (tlayer2.top>0&&tlayer2.top<=5)
	{
		tlayer2.top=0
		setTimeout("move2(tlayer2)",scrollertime)
		setTimeout("move1(document.main.document.first)",scrollertime)
		return
	}
	if (tlayer2.top>=tlayer2.document.height*-1)
	{
		tlayer2.top-=5
		setTimeout("move2(tlayer2)",50)
	}
	else
	{
		tlayer2.top=parseInt(scrollerheight)
		tlayer2.document.write(messages[i])
		tlayer2.document.close()
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

function move3(whichdiv)
{
	tdiv=eval(whichdiv)
	if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5)
	{
		tdiv.style.top=0+"px"
		setTimeout("move3(tdiv)",scrollertime)
		setTimeout("move4(second2_obj)",scrollertime)
		return
	}
	if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1)
	{
		tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
		setTimeout("move3(tdiv)",50)
	} 
	else
	{
		tdiv.style.top=parseInt(scrollerheight)
		tdiv.innerHTML=messages[i]
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

function move4(whichdiv)
{
	tdiv2=eval(whichdiv)
	if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5)
	{
		tdiv2.style.top=0+"px"
		setTimeout("move4(tdiv2)",scrollertime)
		setTimeout("move3(first2_obj)",scrollertime)
		return
	}
	if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1)
	{
		tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
		setTimeout("move4(second2_obj)",50)
	}
	else
	{
		tdiv2.style.top=parseInt(scrollerheight)
		tdiv2.innerHTML=messages[i]
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

function startscroll()
{
	if (ie||dom)
	{
		first2_obj=ie? first2 : document.getElementById("first2")
		second2_obj=ie? second2 : document.getElementById("second2")
		move3(first2_obj)
		second2_obj.style.top=scrollerheight
		second2_obj.style.visibility='visible'
	}
	else if (document.layers)
	{
		document.main.visibility='show'
		move1(document.main.document.first)
		document.main.document.second.top=parseInt(scrollerheight)+5
		document.main.document.second.visibility='show'
	}
}

window.onload=startscroll
</script>
<ilayer id="main" width=&{scrollerwidth}; height=&{scrollerheight}; bgColor=&{scrollerbgcolor}; background=&{scrollerbackground}; visibility=hide>
<layer id="first" left=0 top=1 width=&{scrollerwidth};>
<script language="JavaScript1.2">
if (document.layers)
document.write(messages[0])
</script>
</layer>
<layer id="second" left=0 top=0 width=&{scrollerwidth}; visibility=hide>
<script language="JavaScript1.2">
if (document.layers)
document.write(messages[dyndetermine=(messages.length==1)? 0 : 1])
</script>
</layer>
</ilayer>
<script language="JavaScript1.2">
if (ie||dom){
document.writeln('<div id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+')">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
document.write(messages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden">')
document.write(messages[dyndetermine=(messages.length==1)? 0 : 1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</div>')
}
</script>
<?
echo $string[0] //ici il m'affiche bien tous ce qu'il y a a l'interieur
?>
C'est pas facile a expliquer, en fait ma variable est bien remplie, le soucis est que lorsque j'essaie de l'afficher dans la boucle while, il n'affiche plus rien du tout, si ma variable serait vide, elle ne m'afficherais rien a l'endroit ou j'affiche cette variable mais la, plus rien n'est afficher. Dans la variable, il y a des balises html, le champ est de type text et j'ai essayer de faire un strig_tags et stripslashes et htmlentities mais c'est pas ça.

Désolé c'est pas très claire