views:

31

answers:

1

http://new.monmouthchineseschool.com/curriculum/cantonese/textbook.php
if you take a look at 'C1'

一 十 十一 十二 十三 二 三 四 五 六 七 八 九

that is how all the links look like.
this is the mysql db for that class

CREATE TABLE IF NOT EXISTS `mon_textbook` (
  `id` int(11) NOT NULL auto_increment,
  `class` varchar(255) NOT NULL,
  `ch` varchar(255) NOT NULL,
  `sTitle` varchar(255) NOT NULL,
  `fTitle` varchar(255) NOT NULL,
  `text` longtext NOT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=117 ;

--
-- Dumping data for table `mon_textbook`
--

INSERT INTO `mon_textbook` (`id`, `class`, `ch`, `sTitle`, `fTitle`, `text`) VALUES
(14, 'C1', '1', '一', '第一課', ''),
(15, 'C1', '2', '二', '第二課', ''),
(16, 'C1', '3', '三', '第三課', ''),
(17, 'C1', '4', '四', '第四課', ''),
(18, 'C1', '5', '五', '第五課', ''),
(19, 'C1', '6', '六', '第六課', ''),
(20, 'C1', '7', '七', '第七課', ''),
(21, 'C1', '8', '八', '第八課', ''),
(22, 'C1', '9', '九', '第九課', ''),
(23, 'C1', '10', '十', '第十課', ''),
(24, 'C1', '11', '十一', '第十一課', ''),
(25, 'C1', '12', '十二', '第十二課', ''),
(26, 'C1', '13', '十三', '第十三課', '');

the sql query that calls it

$sql = 'SELECT * FROM '.dbPre.'textbook WHERE `class`="'.$textbookClass[$ii].'" ORDER BY `ch` ASC';

instead of looking like how it is above, it should look like this

一 二 三 四 五 六 七 八 九 十 十一 十二 十三

+4  A: 

Your ch column contains strings, and they are sorted but alphanumerically, not numerically. Your results are in this order '1 10 11 12 13 2 3 4 ...'

Either change your ch column to an integer type, or cast it to an integer in the ORDER BY. I'd recommend the former.

Mark Byers
And how can you detect numbers and decode them form such images? I can only detect first 5 numbers 1 2 3 4 5
osgx