Re: illegal string index

From: Date: Wed, 28 Feb 2001 15:23:55 +0000
Subject: Re: illegal string index
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-42034@lists.php.net to get a copy of this message
I usually put '' around my indexs if they are not numeric, sometimes I dont have to sometimes I do, so I allways do. $ip[$t] = $waarden['ip']; another note is check if there are any NULL entries in the 'ip' field in your db. if a field is NULL then php does not create that index. and you will get an undefined index error. mysql> alter table TABLE_NAME change VAR_NAME VAR_NAME varchar(255) NOT NULL ; please email me if you have more questions or comments, I am interested in knowing how this works for you -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 lee@mediawaveonline.com ""E. Uytterhoeven"" <inc@rendo.dekooi.nl> wrote in message news:97ir7c$e8v$1@toye.p.sourceforge.net... Hi, I made a site that uses the following code: $id = base64_decode($go); // decoding ID $DataBaseNaam = "teller"; // name of DB include('connect.inc.php3'); // connection to DB $query = "select * from kl".$id;//query $result = mysql_db_query($DataBaseNaam, $query); // getting ResultSet $t=0; while ($waarden = mysql_fetch_array($result)) // extracting ata from RS { $ip[$t] = $waarden[ip]; // IP value (varchar) <-- This line generates the problem..? $datum[$t] = $waarden[datum]; // date value (integer) $urlprov[$t] = $waarden[urlprov]; // URL value (varchar) $t++; } On a locale machine (using PHP4) I didn't have any problems, but on internet (using PHP 3.0.16) I got the warning "illegal string index on line ..." I only get this warning if I want to extract IP numbers from my DB. Does anyone knows why I get this warning ? Thanks, Eelco -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#42034) next »