The program below lists the data of that id after you enter the id. Then you can modify the file and write it into it.
<Html>
<Body>
<H1> database data update <?
If (isset ($ id ))
{
If (! Mysql_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_db_query ("elong", $ query); // execute write
If (! $ Result)
{Echo "error! ";
Exit ();
}
Echo "$ id updated! <Br> ";
Echo "<table> n
<Tr> n
<Td> ID <td> $ id </tr> n
<Tr> n
<Td> url <td> $ url </tr> n
<Tr> n
<Td> thumbnail <td> $ mess </tr> n
<Tr> n
<Td> description <td> $ fromx </tr> n
<Tr> n
<Td> url 1 <td> $ url1 </tr> n
<Tr> n
<Td> Fig 1 <td> $ mess1 </tr> n
<Tr> n
<Td> description 1 <td> $ fromx1 </tr> n
<Tr> n
<Td> url address 2 <td> $ url2 </tr> n
<Tr> n
<Td> Fig 2 <td> $ mess2 </tr> n
<Tr> n
<Td> Note 2 <td> $ fromx2 </tr> n
<Tr> n
<Td> url 3 <td> $ url3 </tr> n
<Tr> n
<Td> Fig 3 <td> $ mess3 </tr> n
<Tr> n
<Td> Note 3 <td> $ fromx3 </tr> n
</Table> n ";
Echo "<a href='set.htm '> return to the home page </a> ";
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! ";
Exit ();
}
$ R = mysql_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"
<Form action = 'ww. php' method = 'post'> n
<Table> n
<Tr> n
<Td> ID: <td> <input type = text name = 'id' value = '$ id'> </tr> n
<Tr> n
<Td> class: <td> <input type = text name = 'jpg 'value =' $ jpg '> </tr> n
<Tr> n
<Td> image url: <td> <input type = text name = 'url' size = '000000' value = '$ url'> </tr> n
<Tr> n
<Td> Note: <td> <input type = text name = 'mess 'size = '000000' value =' $ mess '> </tr> n
<Tr> n
<Td> from: <td> <input type = text name = 'fromx 'size = '000000' value =' $ fromx '> </tr> n
<Tr> n
<Td> image url: <td> <input type = text name = 'url1' size = '000000' value = '$ url1'> </tr> n
<Tr> n
<Td> Note: <td> <input type = text name = 'mess1' size = '000000' value = '$ mess1'> </tr> n
<Tr> n
<Td> from: <td> <input type = text name = 'fromx1 'size = '000000' value =' $ fromx1 '> </tr> n
<Tr> n
<Td> image url: <td> <input type = text name = 'url2 'size = '000000' value =' $ url2 '> </tr> n
<Tr> n
<Td> Note: <td> <input type = text name = 'mess2' size = '000000' value = '$ mess2'> </tr> n
<Tr> n
<Td> from: <td> <input type = text name = 'fromx2 'size = '000000' value =' $ fromx2 '> </tr> n
<Tr> n
<Td> image url: <td> <input type = text name = 'url3 'size = '000000' value =' $ url3 '> </tr> n
<Tr> n
<Td> Note: <td> <input type = text name = 'mess3' size = '000000' value = '$ mess3'> </tr> n
<Tr> n
<Td> from: <td> <input type = text name = 'fromx3 'size = '000000' value =' $ fromx3 '> </tr> n
</Table> n
<Input type = submit value = 'update'> n
</Form> n ";
}
Else
{?>
<H3> enter the id to be changed: <Center> <form action = 'ww. php' method = 'post'>
<Br>
Anime tablecloth
<Input type = "radio" name = "jpg" value = "jpg" checked>
Landscape color watercolor
<Input type = "radio" name = "jpg" value = "jpg1">
Star photo
<Input type = "radio" name = "jpg" value = "jpg2">
Ad Creativity
<Input type = "radio" name = "jpg" value = "jpg3">
Other classes
<Input type = "radio" name = "jpg" value = "jpg4">
<Br>
<Input type = text name = 'id'>
<Input type = submit value = 'query'>
</Form> </center>
<?}?>
</Body>
</Html>
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.