newbie PHP/MySQL question

From: Date: Tue, 03 Jan 2006 02:18:50 +0000
Subject: newbie PHP/MySQL question
Groups: php.db 
Request: Send a blank email to php-db+get-40954@lists.php.net to get a copy of this message
A table with a column big5 char(2) not null primary key. $target->query("delete from canton"); for ($ii=0; $ii<256; $ii++) { for ($jj=0; $jj<256; $jj++) { echo $ii .".". $jj . "\n"; $query="insert into canton ( big5 ) values ( '" . mysql_real_escape_string(chr($ii).chr($jj)) . "' )"; $target->query($query); } } The program died with this output: 0.92 0.93 0.94 0.95 0.96 0.97 Duplicate entry '' for key 1 The character strings are unique. Why did it find a duplicate at (0,97)?

« previous php.db (#40954) next »