我有一个SQL查询,根据日期在博客上显示评论.我想忽略第一个并显示所有其余的东西,这是我无法正确做到的.
到目前为止我的代码是:
SELECT DISTINCT comment_post_ID, comment_date_gmt, comment_content
FROM $wpdb->comments
WHERE comment_post_ID = {$thePostID}
ORDER BY comment_date_gmt ASC
LIMIT 5
Run Code Online (Sandbox Code Playgroud) 如果您忘记有时关闭连接会在一段时间内关闭,自动或将保持打开状态?
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
$db = mysql_select_db(DB_DATABASE);
.
.
your code
.
.
and you forget to mysql_close($link);
Run Code Online (Sandbox Code Playgroud) 当我使用jquery脚本进行内联窗口和原型来设置菜单时,我遇到了冲突.当我使用其中一个工作正常.但是当我同时使用它们时,只有原型才有效.我读到了一个关于jquery.noconflict但我可以正确使用它.那些是脚本.
这是我的jquery脚本(内联窗口)
<script type="text/javascript">
$(document).ready(function(){
//When you click on a link with class of poplight and the href starts with a #
$('a.poplight[href^=#]').click(function() {
var popID = $(this).attr('rel'); //Get Popup Name
var popURL = $(this).attr('href'); //Get Popup href to define size
//Pull Query & Variables from href URL
var query= popURL.split('?');
var dim= query[1].split('&');
var popWidth = dim[0].split('=')[1]; //Gets the first query string value
//Fade in the Popup and add close button
$('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend(''); …Run Code Online (Sandbox Code Playgroud) 我构建了以下正则表达式
preg_match_all('#(autom(.*?)tic|(.*?)anual)#', $str2b, $gears);
Run Code Online (Sandbox Code Playgroud)
但我想改变它以匹配希腊字符.我想要匹配的话???????, ?????????但我不能让它工作.
preg_match_all('#(?????(.*?)?|??????(.*?)??)#', $str2b, $gears);
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
我使用以下代码从Twitter中提取一些用户名.到目前为止我做的是这样:
[0] => com/USERNAME/statuses/167362593990778881USERNAME@twitter.
[1] => com/ANOTHER_USERNAME/statuses/167362593390997506ANOTHER_USERNAME@twitter.
Run Code Online (Sandbox Code Playgroud)
这是我的代码..我怎么才能只提取用户名?
$file = file_get_contents("http://search.twitter.com/search.rss?q=twitter");
$file = strip_tags($file);
preg_match_all("([a-z0-9!#$%&'*+/=?^_`{|}~-]*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)\b)siU", $file, $matches);
echo '<pre>';
print_r($matches);
echo '</pre>';
Run Code Online (Sandbox Code Playgroud)
我使用simplexml做了这个,但我得到的只是第一个结果
$url="http://search.twitter.com/search.atom?q=hello";
$twitter_xml = simplexml_load_file($url);
foreach ($twitter_xml->entry->author as $key) {
$author = $key->{"uri"};
echo"<li><h5>$author</h5></li>";
}
Run Code Online (Sandbox Code Playgroud) 在我的网站上,我对所有页面都有相同的标题.所以我使用include头部的函数.这包括所有<head></head>.
因为它<title>是可变的,取决于页面,我把它放在后面<body>.
我知道这是错的.如何修复此问题并将变量移到<title>标准内<head>?
谢谢
我正确使用谷歌地图自动完成,但我想限制显示到特定国家/地区的所有地方.
我应该对代码做什么修改才能实现?
function initAutocomplete() {
autocomplete = new google.maps.places.Autocomplete(
(document.getElementById('autocomplete')),
{types: ['geocode']});
}
function geolocate() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var geolocation = {
lat: position.coords.latitude,
lng: position.coords.longitude
};
var circle = new google.maps.Circle({
center: geolocation,
radius: position.coords.accuracy
});
autocomplete.setBounds(circle.getBounds());
})
;
}
}
Run Code Online (Sandbox Code Playgroud) 在我的注册表格中,用户将添加他的电子邮件,然后收到一封电子邮件以验证他的帐户.但是,我希望有一个简单的电子邮件验证,我想知道以下是否合适.
<?php
$email = "someone@example.com";
if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
echo "Valid email address.";
}
else {
echo "Invalid email address.";
}
?>
Run Code Online (Sandbox Code Playgroud) 我正在将bootstrap轮播实现到我的页面中,但是我只能看到第一个项目(包含3个部分)而不是其他两个.
在bootply http://www.bootply.com/A465PmKBRm它正在工作,但不在我的网站上.用我正在使用的版本测试它.
我在这里错过了什么?
<div class="row">
<div id="carousel-content" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-content" data-slide-to="0" class="active"></li>
<li data-target="#carousel-content" data-slide-to="1" class=""></li>
<li data-target="#carousel-content" data-slide-to="2" class=""></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<!-- SINGLE SERVICE -->
<div class="col-md-4 single-service wow fadeIn animated animated animated" data-wow-offset="10" data-wow-duration="1.5s" style="visibility: visible; -webkit-animation-duration: 1.5s;">
<!-- SERVICE HEADING -->
<h3>text</h3>
<!-- SERVICE DESCRIPTION -->
<p>description</p>
</div>
<!-- /END SINGLE SERVICE -->
<!-- SINGLE SERVICE -->
<div class="col-md-4 …Run Code Online (Sandbox Code Playgroud) php ×5
javascript ×3
jquery ×3
html ×2
mysql ×2
regex ×2
conflict ×1
css ×1
google-maps ×1
preg-match ×1
prototypejs ×1
sql ×1
unicode ×1