Separating html pages based on the CI framework-php Tutorial

Source: Internet
Author: User
After separating html pages based on the CI framework, I found a shift function on the Internet, but the code is php, mysql, and html mashups. now I am using the CI framework. I just got started with the framework, no separation. Please help separate this page according to the CI framework mode
Database page: class_moder.php
Processing page: admin. php
Html page: sort.html

   
  News is moved up and down        
 Query ("select * from 'article' where 'weight'> '$ _ GET [weight] 'Order by 'weight' asc limit 1 "); if ($ conn-> db_num_rows (query)> 0) {$ rows = $ conn-> fetch_array ($ query ); $ conn-> query ("update 'article' set 'weight' = '$ rows [weight] 'Where 'weight' =' $ _ GET [weight] '"); $ conn-> query ("update 'article' set 'weight' = '$ _ GET [weight] 'Where 'id' =' $ rows [ID] '");} else {echo "script" alert ('already at the top '); script ";}} else I F ($ _ GET ["move"] = "down ") {// Obtain the next news information $ query = $ conn-> query ("select * from 'article' where 'weight' <'$ _ GET [weight] 'Order by 'weight 'desclimit 1 "); if ($ conn-> db_num_rows (query)> 0) {$ rows = $ conn-> fetch_array ($ query ); $ conn-> query ("update 'article' set 'weight' = '$ rows [weight] 'Where 'weight' =' $ _ GET [weight] '"); $ conn-> query ("update 'article' set 'weight' = '$ _ GET [weight] 'Where 'id' =' $ rows [ID] '");} el Se {echo "script" alert ('bottom already '); script ";}}}?>
 
  Query ("select * from 'article' order by 'weight' desc"); if ($ conn-> db_num_rows ($ query)> 0) {while ($ rows = $ conn-> fetch_array ($ query) {$ aid []. = $ rows ["ID"];?> 
   
Move articles up and down
ID Title Mobile
? Weight = & Move = up "> move up /? Weight = & Move = down "> move down


Reply to discussion (solution)

This ...... The official CI documentation provides a complete example to show how to score points.

Read the document and find out how to get it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.