Desktop center (3) modify database _ PHP Tutorial

Source: Internet
Author: User
Desktop center (3) modify the database. The program below lists the data of that id after you enter the id. After modification, you can write the. HTML bodyh1 database data update h1? If (isset (id) if (! MySQL (set up the following program with PHP to list the data of that id after you enter the id. Then you can modify the file and write it into it.


Database data update
If (isset ($ id ))
{
If (! MySQL (best combination with PHP) _ connect ("localhost", "username", "password "))
{Echo "unable to connect to database ";
Exit ();
}
If (isset ($ url ))
{
$ Query = "update $ jpg set id = $ id, url = $ url, mess = $ mess,
Fromx = $ fromx, url1 = $ url1, mess1 = $ mess1, fromx1 = $ fromx1, url2 = $ url2,
Mess2 = $ mess2, fromx2 = $ fromx2, url3 = $ url3, mess3 = $ mess3, fromx3 = $ fromx3
Where id = $ id ";
$ Result = MySQL (the best combination with PHP) _ db_query ("elong", $ query); // execute write

If (! $ Result)
{Echo "error! ";
Exit ();
}
Echo "$ id updated!

";
Echo"


























N N N N N N N N N N N N N N N N N N N N N N N N N N N
ID $ Id
Url $ Url
Thumbnail $ Mess
Description $ Fromx
Url address 1 $ Url1
Small $ Mess1
Description 1 $ Fromx1
Url address 2 $ Url2
Small $ Mess2
Description 2 $ Fromx2
Url 3 $ Url3
Small $ Mess3
Description 3 $ Fromx3
N ";
Echo "back to homepage ";
Exit ();
}
$ Query = "SELECT id, url, mess, fromx, url1, mess1, fromx1, url2, mess2, fromx2, url3, mess3, fromx3 from $ jpg
Where id = $ id ";
$ Result = MySQL (the best combination with PHP) _ db_query ("elong", $ query );
If (! $ Result)
{Echo "error! ";
Exit ();
}
$ R = MySQL (the best combination with PHP) _ fetch_array ($ result );
$ Id = $ r ["id"];
$ Url = $ r ["url"];
$ Mess = $ r ["mess"];
$ Fromx = $ r ["fromx"];
$ Url1 = $ r ["url1"];
$ Mess1 = $ r ["mess1"];
$ Fromx1 = $ r ["fromx1"];
$ Url2 = $ r ["url2"];
$ Mess2 = $ r ["mess2"];
$ Fromx2 = $ r ["fromx2"];
$ Url3 = $ r ["url3"];
$ Mess3 = $ r ["mess3"];
$ Fromx3 = $ r ["fromx3"];
Echo"
N




















Bytes. Then you can modify and write the. html body h1 database data update/h1? If (isset (id) if (! MySQL (with PHP...

N N N N N N N N N N N N N N N N N N N N N
ID:
Class:
Image url:
Note:
From:
Image url:
Note:
From:
Image url:
Note:

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.