Easy Online Voting system php--home get information

Source: Internet
Author: User
The way the page gets information is consistent with the way I publish the polling page.

 
          
 
  "."". $row [' VName ']. " Publisher: ". $username [0]."
Release date: ". $row [' StartTime ']." ".". $intro. "". "". "";} ? " >
1. Submit the SQL statement through the mysql_query () method and obtain the query result.

$sql = "Select Vid,vname,starttime,uid,vintro from Vote ORDER by vid DESC"; $voteItem =mysql_query ($sql);
2, through the cycle, the use of the Mysql_fetch_array () method, each time to obtain a record, and through the loop, get the information in one article. In the process of looping, the corresponding data is added to the string and displayed in this way to automatically display the records in the page function.

(Note: The difference between the Mysql_fetch_array () method and the Mysql_fetch_row () method.) The array method is more like the enhanced version of the row method, and the array method obtains the information for each record in an array, with the table header as the table below, to facilitate subsequent calls. The row method has no back-up functionality. )

3, because the limit of the page amplitude, can only show part of the voting profile, here only to intercept the first 100 words in the page display, and after adding "..."

$intro =substr ($row [' Vintro '],0,300). ......";
(The next Chinese character in the UTF8 format represents 3 characters, so it is set to 300 characters.) )

The above describes the simple online voting system php--home page to get information, including the content of the subject, I hope that the PHP tutorial interested in friends to help.

  • Related Article

    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.