当前位置: 编程技术>php
本页文章导读:
▪php桌面中心(四) 数据显示
最后一步就是显示了。 下面这个程序要通过参数来调用。 比如php.php?jpg=jpg 后面的jpg是表格名。记住一定要的呀,不然就不能运行了,会显示程序出错。 大家可以把下面这个程序改一下.........
▪php桌面中心(三) 修改数据库
下面这个程序在你输入id后就把那个id的数据列出来。然后你就可以修改后写入了. <html> <body> <h1>数据库的数据更新</h1> <? if(isset($id)) { if(!mysql_connect("localhost",".........
▪php桌面中心(二) 数据库写入
一、以下是数据库的写入的html程序,你可以加入密码功能。把密码做成变量发入下面那个写入的php程序。这样就实现了密码保护了: <html> <head> <title>数据库</title> <.........
[1]php桌面中心(四) 数据显示
来源: 互联网 发布时间: 2013-11-30
最后一步就是显示了。
下面这个程序要通过参数来调用。
比如php.php?jpg=jpg
后面的jpg是表格名。记住一定要的呀,不然就不能运行了,会显示程序出错。
大家可以把下面这个程序改一下。这样就可以更加美观了。
以下是源程序:
<html>
<head><title>显示</title>
</head>
<body>
<?
mysql_connect("localhost","用户名","密码") or die("无法联接数据库!");
$query="SELECT id,url,mess,fromx,url1,mess1,fromx1,url2,mess2,fromx2,url3,mess3,fromx3 from $jpg " ;
$result=mysql_db_query("elong",$query); //执行查询
$num=mysql_numrows($result);
$page=round($page);
$pagesize=4;
if ($page==0){
$page=1;}
else{
$page=$page;}
$pagecount=($num)/$pagesize;
$pagecount=ceil($pagecount);
?>
<?if ($page!=1 and $num!=0){
printf("<a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html">首页</a>",$PHP_SELF,1);
printf("<a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html"> 前页</a>",$PHP_SELF,$page-1);
}else{
?> 首页 前页 <?
}
?>
</font>
<?if ($page!=$pagecount and $num!=0){
printf("<a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html"> 后页</a>",$PHP_SELF,$page+1);
printf("<a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html"> 尾页</a>",$PHP_SELF,$pagecount);
}else{?> 后页 尾页 <?}?>页次:<strong><?echo $page?></strong>/<strong><?echo $pagecount?></strong>页
</span></td>
<?
if ($num<>0){
$pp=0;
for($ipage=0;$ipage<$pagesize;$ipage++){
$i=($page-1)*$pagesize+$ipage;
if($i < $num) {
$id=mysql_result($result,$i,"id");
$url=mysql_result($result,$i,"url");
$mess=mysql_result($result,$i,"mess");
$fromx=mysql_result($result,$i,"fromx");
$url1=mysql_result($result,$i,"url1");
$mess1=mysql_result($result,$i,"mess1");
$fromx1=mysql_result($result,$i,"fromx1");
$url2=mysql_result($result,$i,"url2");
$mess2=mysql_result($result,$i,"mess2");
$fromx2=mysql_result($result,$i,"fromx2");
$url3=mysql_result($result,$i,"url3");
$mess3=mysql_result($result,$i,"mess3");
$fromx3=mysql_result($result,$i,"fromx3");
$pp=$pp+1;
?>
<table width="668" border="2" cellspacing="0" cellpadding="0" align="center" bordercolor="#FFFFFF">
<tr>
<td width="167" height="127"> <a href="/blog_article/</echo $url/gt;.html" target="_blank"><IMG border=0 src="/blog_article/</echo $mess/gt;.html" width="160" height="120" border="4"></td>
<td width="167" height="127"><a href="/blog_article/</echo $url1/gt;.html" target="_blank"><IMG border=0 src="/blog_article/</echo $mess1/gt;.html" width="160" height="120" border="4"></td>
<td width="167" height="127"><a href="/blog_article/</echo $url2/gt;.html" target="_blank"><IMG border=0 src="/blog_article/</echo $mess2/gt;.html" width="160" height="120" border="4"></td>
<td width="167" height="127"><a href="/blog_article/</echo $url3/gt;.html" target="_blank"><IMG border=0 src="/blog_article/</echo $mess3/gt;.html" width="160" height="120" border="4"></td>
</tr>
</table>
<?
}
}
}
?>
<td nowrap align=center> <span <a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html">首页</a>",$PHP_SELF,1);
printf("<a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html"> 前页</a>",$PHP_SELF,$page-1);
}else{
?> 首页 前页 <?}?> </font> <?if ($page!=$pagecount and $num!=0){
printf("<a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html"> 后页</a>",$PHP_SELF,$page+1);
printf("<a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html"> 尾页</a>",$PHP_SELF,$pagecount);
}else{?> 后页 尾页 <?}?>页次:<strong><?echo $page?></strong>/<strong><?echo $pagecount?></strong>页
</span></td>
</TABLE></DIV></CENTER>
</BODY></HTML>
下面这个程序要通过参数来调用。
比如php.php?jpg=jpg
后面的jpg是表格名。记住一定要的呀,不然就不能运行了,会显示程序出错。
大家可以把下面这个程序改一下。这样就可以更加美观了。
以下是源程序:
<html>
<head><title>显示</title>
</head>
<body>
<?
mysql_connect("localhost","用户名","密码") or die("无法联接数据库!");
$query="SELECT id,url,mess,fromx,url1,mess1,fromx1,url2,mess2,fromx2,url3,mess3,fromx3 from $jpg " ;
$result=mysql_db_query("elong",$query); //执行查询
$num=mysql_numrows($result);
$page=round($page);
$pagesize=4;
if ($page==0){
$page=1;}
else{
$page=$page;}
$pagecount=($num)/$pagesize;
$pagecount=ceil($pagecount);
?>
<?if ($page!=1 and $num!=0){
printf("<a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html">首页</a>",$PHP_SELF,1);
printf("<a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html"> 前页</a>",$PHP_SELF,$page-1);
}else{
?> 首页 前页 <?
}
?>
</font>
<?if ($page!=$pagecount and $num!=0){
printf("<a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html"> 后页</a>",$PHP_SELF,$page+1);
printf("<a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html"> 尾页</a>",$PHP_SELF,$pagecount);
}else{?> 后页 尾页 <?}?>页次:<strong><?echo $page?></strong>/<strong><?echo $pagecount?></strong>页
</span></td>
<?
if ($num<>0){
$pp=0;
for($ipage=0;$ipage<$pagesize;$ipage++){
$i=($page-1)*$pagesize+$ipage;
if($i < $num) {
$id=mysql_result($result,$i,"id");
$url=mysql_result($result,$i,"url");
$mess=mysql_result($result,$i,"mess");
$fromx=mysql_result($result,$i,"fromx");
$url1=mysql_result($result,$i,"url1");
$mess1=mysql_result($result,$i,"mess1");
$fromx1=mysql_result($result,$i,"fromx1");
$url2=mysql_result($result,$i,"url2");
$mess2=mysql_result($result,$i,"mess2");
$fromx2=mysql_result($result,$i,"fromx2");
$url3=mysql_result($result,$i,"url3");
$mess3=mysql_result($result,$i,"mess3");
$fromx3=mysql_result($result,$i,"fromx3");
$pp=$pp+1;
?>
<table width="668" border="2" cellspacing="0" cellpadding="0" align="center" bordercolor="#FFFFFF">
<tr>
<td width="167" height="127"> <a href="/blog_article/</echo $url/gt;.html" target="_blank"><IMG border=0 src="/blog_article/</echo $mess/gt;.html" width="160" height="120" border="4"></td>
<td width="167" height="127"><a href="/blog_article/</echo $url1/gt;.html" target="_blank"><IMG border=0 src="/blog_article/</echo $mess1/gt;.html" width="160" height="120" border="4"></td>
<td width="167" height="127"><a href="/blog_article/</echo $url2/gt;.html" target="_blank"><IMG border=0 src="/blog_article/</echo $mess2/gt;.html" width="160" height="120" border="4"></td>
<td width="167" height="127"><a href="/blog_article/</echo $url3/gt;.html" target="_blank"><IMG border=0 src="/blog_article/</echo $mess3/gt;.html" width="160" height="120" border="4"></td>
</tr>
</table>
<?
}
}
}
?>
<td nowrap align=center> <span <a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html">首页</a>",$PHP_SELF,1);
printf("<a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html"> 前页</a>",$PHP_SELF,$page-1);
}else{
?> 首页 前页 <?}?> </font> <?if ($page!=$pagecount and $num!=0){
printf("<a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html"> 后页</a>",$PHP_SELF,$page+1);
printf("<a href="/blog_article/%s/page/%s/amp;jpg/$jpg.html"> 尾页</a>",$PHP_SELF,$pagecount);
}else{?> 后页 尾页 <?}?>页次:<strong><?echo $page?></strong>/<strong><?echo $pagecount?></strong>页
</span></td>
</TABLE></DIV></CENTER>
</BODY></HTML>
[2]php桌面中心(三) 修改数据库
来源: 互联网 发布时间: 2013-11-30
下面这个程序在你输入id后就把那个id的数据列出来。然后你就可以修改后写入了.
<html>
<body>
<h1>数据库的数据更新</h1>
<?
if(isset($id))
{
if(!mysql_connect("localhost","用户名","密码"))
{echo"无法联接数据库";
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); //执行写入
if (!$result)
{echo "发生错误!";
exit();
}
echo "$id 已经更新!<br><br>";
echo "<table>n
<tr>n
<td>ID<td>$id</tr>n
<tr>n
<td>url地址<td>$url</tr>n
<tr>n
<td>小图<td>$mess</tr>n
<tr>n
<td>说明<td>$fromx</tr>n
<tr>n
<td>url地址1<td>$url1</tr>n
<tr>n
<td>小图1<td>$mess1</tr>n
<tr>n
<td>说明1<td>$fromx1</tr>n
<tr>n
<td>url地址2<td>$url2</tr>n
<tr>n
<td>小图2<td>$mess2</tr>n
<tr>n
<td>说明2<td>$fromx2</tr>n
<tr>n
<td>url地址3<td>$url3</tr>n
<tr>n
<td>小图3<td>$mess3</tr>n
<tr>n
<td>说明3<td>$fromx3</tr>n
</table>n";
echo "<a href='/blog_article/set.htm'>回到首页</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 "发生错误!";
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='/blog_article/ww.html' method='post'>n
<table>n
<tr>n
<td>ID:<td> <input type=text name='id' value='$id'></tr>n
<tr>n
<td>类形:<td> <input type=text name='jpg' value='$jpg'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url' size='100' value='$url'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess' size='100' value='$mess'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx' size='100' value='$fromx'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url1' size='100' value='$url1'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess1' size='100' value='$mess1'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx1' size='100' value='$fromx1'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url2' size='100' value='$url2'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess2' size='100' value='$mess2'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx2' size='100' value='$fromx2'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url3' size='100' value='$url3'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess3' size='100' value='$mess3'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx3' size='100' value='$fromx3'></tr>n
</table>n
<input type=submit value='更新'>n
</form>n";
}
else
{?>
<h3>请输放需要更改的id:</h3>
<center><form action='/blog_article/ww.html' method='post'>
<br>
动漫桌布
<input type="radio" name="jpg" value="jpg" checked>
平分秋色水彩画
<input type="radio" name="jpg" value="jpg1">
明星写真
<input type="radio" name="jpg" value="jpg2">
广告创意
<input type="radio" name="jpg" value="jpg3">
其它类
<input type="radio" name="jpg" value="jpg4">
<br>
<input type=text name='id'>
<input type=submit value='查询'>
</form></center>
<?}?>
</body>
</html>
<html>
<body>
<h1>数据库的数据更新</h1>
<?
if(isset($id))
{
if(!mysql_connect("localhost","用户名","密码"))
{echo"无法联接数据库";
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); //执行写入
if (!$result)
{echo "发生错误!";
exit();
}
echo "$id 已经更新!<br><br>";
echo "<table>n
<tr>n
<td>ID<td>$id</tr>n
<tr>n
<td>url地址<td>$url</tr>n
<tr>n
<td>小图<td>$mess</tr>n
<tr>n
<td>说明<td>$fromx</tr>n
<tr>n
<td>url地址1<td>$url1</tr>n
<tr>n
<td>小图1<td>$mess1</tr>n
<tr>n
<td>说明1<td>$fromx1</tr>n
<tr>n
<td>url地址2<td>$url2</tr>n
<tr>n
<td>小图2<td>$mess2</tr>n
<tr>n
<td>说明2<td>$fromx2</tr>n
<tr>n
<td>url地址3<td>$url3</tr>n
<tr>n
<td>小图3<td>$mess3</tr>n
<tr>n
<td>说明3<td>$fromx3</tr>n
</table>n";
echo "<a href='/blog_article/set.htm'>回到首页</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 "发生错误!";
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='/blog_article/ww.html' method='post'>n
<table>n
<tr>n
<td>ID:<td> <input type=text name='id' value='$id'></tr>n
<tr>n
<td>类形:<td> <input type=text name='jpg' value='$jpg'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url' size='100' value='$url'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess' size='100' value='$mess'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx' size='100' value='$fromx'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url1' size='100' value='$url1'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess1' size='100' value='$mess1'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx1' size='100' value='$fromx1'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url2' size='100' value='$url2'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess2' size='100' value='$mess2'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx2' size='100' value='$fromx2'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url3' size='100' value='$url3'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess3' size='100' value='$mess3'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx3' size='100' value='$fromx3'></tr>n
</table>n
<input type=submit value='更新'>n
</form>n";
}
else
{?>
<h3>请输放需要更改的id:</h3>
<center><form action='/blog_article/ww.html' method='post'>
<br>
动漫桌布
<input type="radio" name="jpg" value="jpg" checked>
平分秋色水彩画
<input type="radio" name="jpg" value="jpg1">
明星写真
<input type="radio" name="jpg" value="jpg2">
广告创意
<input type="radio" name="jpg" value="jpg3">
其它类
<input type="radio" name="jpg" value="jpg4">
<br>
<input type=text name='id'>
<input type=submit value='查询'>
</form></center>
<?}?>
</body>
</html>
[3]php桌面中心(二) 数据库写入
来源: 互联网 发布时间: 2013-11-30
一、以下是数据库的写入的html程序,你可以加入密码功能。把密码做成变量发入下面那个写入的php程序。这样就实现了密码保护了:
<html>
<head>
<title>数据库</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.p9 { font-size: 9pt}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<div align="center">
<p >数据库管理程序<br>
<br>
<a href="/blog_article/mysql.html">查看数据库资料 </a></p>
<p ><a href="/blog_article/ww.html">改资料</a><br>
</p>
<form method="post" action="/blog_article/wsql.html">
<p align="left"><span >图片url地址
<input type="text" name="url" size="100">
<br>
<br>
图片小图
<input type="text" name="mess" size="100">
<br>
<br>
说明
<input type="text" name="fromx" size="100">
</span></p>
<p align="left"><span >图片url地址1
<input type="text" name="url1" size="100">
<br>
<br>
图片小图1
<input type="text" name="mess1" size="100">
<br>
<br>
说明1
<input type="text" name="fromx1" size="100">
</span></p>
<p align="left"><span >图片url地址2
<input type="text" name="url2" size="100">
<br>
<br>
图片小图2
<input type="text" name="mess2" size="100">
<br>
<br>
说明2
<input type="text" name="fromx2" size="100">
</span></p>
<p align="left" ><span >图片url地址3
<input type="text" name="url3" size="100">
<br>
<br>
图片小图3
<input type="text" name="mess3" size="100">
<br>
<br>
说明3
<input type="text" name="fromx3" size="100">
</span><br>
<br>
平分秋色水彩画
<input type="radio" name="jpg" value="jpg" checked>
<br>
明星写真
<input type="radio" name="jpg" value="jpg1">
<br>
动漫桌布
<input type="radio" name="jpg" value="jpg2">
<br>
广告创意
<input type="radio" name="jpg" value="jpg3">
<br>
其它类
<input type="radio" name="jpg" value="jpg4">
<br>
<br>
<input type="submit" name="Submit" value="提交">
<br>
</p>
</form>
</div>
</body>
</html>
二、然后是处理这个提交的php程序:
<html>
<head><title>查找</title>
</head>
<body>
<h1>数据库的数据</h1>
<?
mysql_connect("localhost","用户名","密码") or die("无法联接数据库!");
$query="insert into $jpg values ('$id','$url','$mess','$fromx','$url1','$mess1','$fromx1','$url2','$mess2','$fromx2','$url3','$mess3','$fromx3')" ;
$result=mysql_db_query("elong",$query); //执行写入
if (mysql_affected_rows()==1)
{
echo "数据已加放数据库 $jpg 中<br><br>";
echo "<table>n
<tr>n
<td>ID<td>$id</tr>n
<tr>n
<td>url地址<td>$url</tr>n
<tr>n
<td>小图<td>$mess</tr>n
<tr>n
<td>说明<td>$fromx</tr>n
<tr>n
<td>url地址1<td>$url1</tr>n
<tr>n
<td>小图1<td>$mess1</tr>n
<tr>n
<td>说明1<td>$fromx1</tr>n
<tr>n
<td>url地址2<td>$url2</tr>n
<tr>n
<td>小图2<td>$mess2</tr>n
<tr>n
<td>说明2<td>$fromx2</tr>n
<tr>n
<td>url地址3<td>$url3</tr>n
<tr>n
<td>小图3<td>$mess3</tr>n
<tr>n
<td>说明3<td>$fromx3</tr>n
</table>n";
}
else echo "系统出了问题,请重试!:(";
mysql_close();
?>
<a href='/blog_article/set.htm'>回到首页</a>
</body>
</html>
<html>
<head>
<title>数据库</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.p9 { font-size: 9pt}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<div align="center">
<p >数据库管理程序<br>
<br>
<a href="/blog_article/mysql.html">查看数据库资料 </a></p>
<p ><a href="/blog_article/ww.html">改资料</a><br>
</p>
<form method="post" action="/blog_article/wsql.html">
<p align="left"><span >图片url地址
<input type="text" name="url" size="100">
<br>
<br>
图片小图
<input type="text" name="mess" size="100">
<br>
<br>
说明
<input type="text" name="fromx" size="100">
</span></p>
<p align="left"><span >图片url地址1
<input type="text" name="url1" size="100">
<br>
<br>
图片小图1
<input type="text" name="mess1" size="100">
<br>
<br>
说明1
<input type="text" name="fromx1" size="100">
</span></p>
<p align="left"><span >图片url地址2
<input type="text" name="url2" size="100">
<br>
<br>
图片小图2
<input type="text" name="mess2" size="100">
<br>
<br>
说明2
<input type="text" name="fromx2" size="100">
</span></p>
<p align="left" ><span >图片url地址3
<input type="text" name="url3" size="100">
<br>
<br>
图片小图3
<input type="text" name="mess3" size="100">
<br>
<br>
说明3
<input type="text" name="fromx3" size="100">
</span><br>
<br>
平分秋色水彩画
<input type="radio" name="jpg" value="jpg" checked>
<br>
明星写真
<input type="radio" name="jpg" value="jpg1">
<br>
动漫桌布
<input type="radio" name="jpg" value="jpg2">
<br>
广告创意
<input type="radio" name="jpg" value="jpg3">
<br>
其它类
<input type="radio" name="jpg" value="jpg4">
<br>
<br>
<input type="submit" name="Submit" value="提交">
<br>
</p>
</form>
</div>
</body>
</html>
二、然后是处理这个提交的php程序:
<html>
<head><title>查找</title>
</head>
<body>
<h1>数据库的数据</h1>
<?
mysql_connect("localhost","用户名","密码") or die("无法联接数据库!");
$query="insert into $jpg values ('$id','$url','$mess','$fromx','$url1','$mess1','$fromx1','$url2','$mess2','$fromx2','$url3','$mess3','$fromx3')" ;
$result=mysql_db_query("elong",$query); //执行写入
if (mysql_affected_rows()==1)
{
echo "数据已加放数据库 $jpg 中<br><br>";
echo "<table>n
<tr>n
<td>ID<td>$id</tr>n
<tr>n
<td>url地址<td>$url</tr>n
<tr>n
<td>小图<td>$mess</tr>n
<tr>n
<td>说明<td>$fromx</tr>n
<tr>n
<td>url地址1<td>$url1</tr>n
<tr>n
<td>小图1<td>$mess1</tr>n
<tr>n
<td>说明1<td>$fromx1</tr>n
<tr>n
<td>url地址2<td>$url2</tr>n
<tr>n
<td>小图2<td>$mess2</tr>n
<tr>n
<td>说明2<td>$fromx2</tr>n
<tr>n
<td>url地址3<td>$url3</tr>n
<tr>n
<td>小图3<td>$mess3</tr>n
<tr>n
<td>说明3<td>$fromx3</tr>n
</table>n";
}
else echo "系统出了问题,请重试!:(";
mysql_close();
?>
<a href='/blog_article/set.htm'>回到首页</a>
</body>
</html>
最新技术文章: