PHP database call problems

Source: Internet
Author: User
Tags php database
Question 1. in the process of creating a web page, you want to write the hyperlink in the Header of the website by calling the database, so that you can easily modify the later Management. The problem is: how to call the form content stored in the database to make it a hyperlink.
2. there are many images in the "partners" column of the website. these images are also hyperlink to other Internet and stored in the database. how can they be called.


Thank you for your great help. I don't know if 100 points will be missing ...... New guy, please help !!


Reply to discussion (solution)


Learn basics first
$ SQL = "select * from your database"
$ Result = mysql_query ($ SQL );
While ($ rs = mysql_fetch_array ($ result )){
Echo "". $ rs [title]. "";
}

You store the hyperlink address in the database and assemble the hyperlink yourself when displaying it.
Images are the same. You save the image address and hyperlink address to the database.

The display is assembled during output.

This is indeed a basic problem.
1. first, simple database operations should be used to add, delete, modify, and query
2. simple database design. for example, you have two functions. In fact, there are mainly two fields in the data group. one is the hyperlink link content and the other is the hyperlink link address!

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.