显示mysql数据

PHP Display Mysqli data

本文关键字:数据 mysql 显示      更新时间:2023-09-26

我需要一些建议。我正在创建一个PHP网站,其中有像20表显示从数据库。

我使用while循环生成20个表并填充其中的数据,没有问题。

但是我想做的是创建一个特定的大小div1,让我们说520 w x 520px h。然后使用循环我生成第一个表的数据和显示,然后该表移动缓慢,直到它从div1消失,我继续这个表的其余部分。

任何人都可以在这里帮助逻辑或指向一个资源,可以帮助我做到这一点。

你是说动画?然后它是一个JS/CSS工作。PHP是服务器端,您在网页中看到的元素是从服务器端下载的。JS和CSS可以在客户端工作,HTML也一样。因此,如果你想制作动画,你应该先制作一个JS函数,让它重复n次。在这个循环中,只需编辑div的样式,就可以了。

如果你不知道怎么做,下面是代码:

var inter = setInterval(animate,20);
var i = 0;
function animate(){
    document.getElementById("div1").style.marginBottom = i+"px";//This will make the div go up if your div id is div1. If not, just change div1 for your id. If you want to move it down, you would have to replace marginBottom for marginTop(this will only work if your div's position is relative).
    i++;
    if(i==200){//When it has moved 200px, it will stop
        clearInterval(inter);
    }
}

注意:上面的代码是一个示例。如果你想让它向左/向右/向下移动,或者它移动500px而不是200px,你必须改变它。用注释

引导自己