Desktop Center (iii) modify Database _php Tutorial

Source: Internet
Author: User
Source: House Orso near Network

Desktop Center (iii) modifying the database
Author: elong

The following program lists the data for that ID after you enter it. Then you can modify it and write it later.


Data updates for Databases


if (Isset ($id))
{
if (!mysql_connect ("localhost", "username", "password"))
{echo "Cannot join database";
Exit ();
}
if (Isset ($url))
{
$query = "Update $jpg set id= ' $id ', url= ' $url ', mess= ' $mess ',
fromx= ' $fromx ', url1= ' $url 1 ', mess1= ' $mess 1 ', fromx1= ' $FROMX 1 ', url2= ' $url 2 ',
Mess2= ' $mess 2 ', fromx2= ' $fromx 2 ', url3= ' $url 3 ', mess3= ' $mess 3 ', fromx3= ' $fromx 3 '
where id= ' $id ';
$result =mysql_db_query ("elong", $query); Perform write

if (! $result)
{echo "error occurred!";
Exit ();
}
echo "$id has been 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 address $url
Small map $mess
Description $fromx
URL Address 1 $url 1
Small Figure 1 $mess 1
Description 1 $FROMX 1
URL Address 2 $url 2
Small Figure 2 $mess 2
Description 2 $FROMX 2
URL Address 3 $url 3
Small Figure 3 $mess 3
Description 3 $FROMX 3
n ";
echo "Back Home";
Exit ();
}
$query = "Select Id,url,mess,fromx,url1,mess1,fromx1,url2,mess2,fromx2,url3,mess3,fromx3 from $jpg
where id= ' $id ';
$result =mysql_db_query ("elong", $query);
if (! $result)
{echo "error occurred!";
Exit ();
}
$r =mysql_fetch_array ($result);
$id = $r ["id"];
$url = $r ["url"];
$mess = $r ["mess"];
$FROMX = $r ["FromX"];
$url 1 = $r ["URL1"];
$mess 1 = $r ["Mess1"];
$FROMX 1 = $r ["Fromx1"];
$url 2 = $r ["Url2"];
$mess 2 = $r ["Mess2"];
$FROMX 2 = $r ["FROMX2"];
$url 3 = $r ["Url3"];
$mess 3 = $r ["MESS3"];
$FROMX 3 = $r ["Fromx3"];
Echo
n ";
}
Else
{?>

Please lose the ID you want to change:










http://www.bkjia.com/PHPjc/315240.html www.bkjia.com true http://www.bkjia.com/PHPjc/315240.html techarticle Source: House Orso near Web Desktop Center (iii) modify database author: elong The following program will list the data for that ID after you enter the ID. Then you can modify it and write it later. HTML b ...

  • 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.