<?php
$conn=mysql_connect("localhost","root","123456");
mysql_query('set names utf8');
mysql_select_db("abc",$conn);
$news=mysql_query("select * from eb_news where categoryId='53' order by createDate");
$a=mysql_num_rows($news);
$i=1;
$i2=1;$conn2=mysql_connect("localhost","root","123456");
mysql_select_db("tjdx",$conn2);
$result=mysql_query("select * from sea_info where categoryid='759' order by dotime");
$b=mysql_num_rows($result);echo '<div style="border:solid 2 red;width:200px; float:left;">';
while($os=mysql_fetch_array($news)){
echo $i;echo '--';echo date('Y-m-d',$os['createDate']);echo '--';echo $os['id'];
echo '<br>';$i++;
mysql_query("insert into sea_info (parentid,categoryid,title,content,dotime) values('744','759','$os[title]','$os[content]','$os[createDate]')");
}
echo'</div>';
echo '<div style="border:solid 2 red;width:200px; float:left;">';
while($os2=mysql_fetch_array($result)){
echo $i2;echo '--';echo date('Y-m-d',$os2['dotime']);
echo '<br>';$i2++;
}
echo'</div>';
echo $b;
echo '<br>';
echo $a;
?>
对比的时候就是少了几条数据,怎么会这样
$conn=mysql_connect("localhost","root","123456");
mysql_query('set names utf8');
mysql_select_db("abc",$conn);
$news=mysql_query("select * from eb_news where categoryId='53' order by createDate");
$a=mysql_num_rows($news);
$i=1;
$i2=1;$conn2=mysql_connect("localhost","root","123456");
mysql_select_db("tjdx",$conn2);
$result=mysql_query("select * from sea_info where categoryid='759' order by dotime");
$b=mysql_num_rows($result);echo '<div style="border:solid 2 red;width:200px; float:left;">';
while($os=mysql_fetch_array($news)){
echo $i;echo '--';echo date('Y-m-d',$os['createDate']);echo '--';echo $os['id'];
echo '<br>';$i++;
mysql_query("insert into sea_info (parentid,categoryid,title,content,dotime) values('744','759','$os[title]','$os[content]','$os[createDate]')");
}
echo'</div>';
echo '<div style="border:solid 2 red;width:200px; float:left;">';
while($os2=mysql_fetch_array($result)){
echo $i2;echo '--';echo date('Y-m-d',$os2['dotime']);
echo '<br>';$i2++;
}
echo'</div>';
echo $b;
echo '<br>';
echo $a;
?>
对比的时候就是少了几条数据,怎么会这样
解决方案 »
- 在手动搭建WAMP时,解压phpMyAdmin文件到htdocs时出现phpmyadmin配置错误
- 菜鸟求助 url请求插入数据库问题
- 这段代码哪里出错
- 这段代码错误在哪里啊
- PHP如何A文件如何从B文件中获取信息?非Form表格传递变量问题
- 【求救-】关于apache,急~~~~~~~
- php中如何建立和使用类数组
- 建议版主们把一切关于讨论什么 JSP、PHP、ASP 哪个好的贴子一律删除.
- 如何将apache+php+mysql制作成一个在开发环境下已经调试好的整体安装文件?谢谢!
- 呵呵,刷新问题,高手看过来!
- Curl号称强大,却在抓花瓣网的首页时,怎么也不能成功,求解!!!!!!!
- WebQQ消息发送功能
$result=mysql_query("select * from sea_info where categoryid='759' order by dotime");
两个结果集的数量相等,纯属巧合mysql_query("insert into sea_info (parentid,categoryid,title,content,dotime) values('744','759','$os[title]','$os[content]','$os[createDate]')");
插入是在查询后进行的,插入的数据不会影响先前查询的结果