|
// 3. Read and Write operations on one of the following!
While (! $ Rs-> eof ){
// $ F = $ rs-> Fields (1); // 1. assign a value (* for debugging)
// Echo $ f-> value; // 2. Check whether it can be written or read (* for debugging)
// Assign values to the variables respectively. 'gb2312' and 'utf-8' are used to solve the garbled problem!
$ Id = iconv ('gb2312', 'utf-8', $ rs-> Fields (ID)-> value); // ID is an access field, or a number
$ Name = iconv ('gb2312', 'utf-8', $ rs-> Fields (title)-> value );
$ Jianjie = iconv ('gb2312', 'utf-8', $ rs-> Fields (1)-> value );
$ Content = iconv ('gb2312', 'utf-8', $ rs-> Fields (content)-> value );
$ Down = iconv ('gb2312', 'utf-8', $ rs-> Fields (download)-> value );
Echo "". $ name. "already inserted
"; // Output insert record
// Execute insert in sequence and the value is a variable
$ SQL = "INSERT INTO 'shopex '. 'sdb _ article' ('Article _ id', 'node _ id', 'title', 'content', 'uptime', 'ifpub', 'align ', 'filetype', 'filename', 'orderlist', 'Disabled ') VALUES ('',' {$ fenlei} ',' {$ name }', '{$ info}', '123', '1', Null, Null, NULL, NULL, 'false ')";
// The preceding is the SQL statement used to insert a MYSQL database.
Mysql_query ($ SQL); // execute the statement!
/// Echo $ rs-> Fields (name)-> value ."
";
$ Rs-> MoveNext ();
// Personal operation for converting ACCESS to mysql database
}
?> |