Define constants

A

Anonymous

Guest
I got this problem after changing code to work with global variables off.

Notice: Use of undefined constant text1 - assumed 'text1'

while ($row = mysql_fetch_array($sql)) {
$row[text1]=ereg_replace("/(\015\012)|(\015)|(\012)/","<br>",$row[text1]);

How to define constants so I wont get that warning msg all the time..

/joli
 
You don't need to know how constants work, PHP just thinks you're using a constant (and then can't find it).

Change every instance of $row[text1] to $row['text1'] and that should work!
 
Back
Top