我为WP编写插件时遇到了一些问题。我需要在我的数据库中显示内容中的一些信息。我编写了一个代码,显示来自我的db dut的问题我有分页的问题,我为它写了很多帖子(像这样:Paginate Wordpress $wpdb)但我只是不明白我需要用我的代码做什么为了分页它。以下是我的代码的一部分,显示了我的数据库中的一些数据:
Only VoIP apps can set KeepAliveTimeout
$sSql = "SELECT * FROM pam INNER JOIN images ON pam.id_fake=images.id_zapis
WHERE id_type = $type LIMIT ... OFFSET ...";
你可以帮我分页这段代码吗?
答案 0 :(得分:0)
该过程的起点是查询,首选解决方案是使用带有常量的常量(注意使用$ wpdb-> prepare清理查询参数):
<html>
<head>
<title>Login</title>
<link rel="stylesheet" href="https://getbootstrap.com/docs/4.0/dist/css/bootstrap.min.css">
</head>
<body>
<div id="app">
<main class="py-4">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-4">
<div class="card">
<div class="card-header">Login</div>
<div class="card-body">
<form role="form" class="row">
<div class="col-sm-12 col-md-12">
<div class="form-group">
<label for="Email Address" class="control-label">UserName Or EmailAddress</label>
<input type="text" name="Email Address" class="form-control">
</div>
</div>
<div class="col-sm-12 col-md-12">
<div class="form-group">
<label for="Password" class="control-label">Password</label>
<input type="password" name="Password" class="form-control">
</div>
</div>
<div class="col-sm-12 col-md-12">
<div class="form-group">
<button type="button" class="btn btn-primary" >
Login
</button>
<a class="btn btn-link" title="Forgot Password">Forgot Password</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
</body>
</html>