小编Ere*_*red的帖子

在WHERE内的IF条件

我需要知道如何在WHERE子句中使用IF条件,我在php中留下了这个想法:

SELECT * FROM table WHERE date >= '2017-08-04' 

IF(date = '2017-08-04' ){
AND hour > '12:00'
}
Run Code Online (Sandbox Code Playgroud)

所以想法是如果date等于今天的日期然后添加 AND hour > '12:00'

mysql sql

1
推荐指数
1
解决办法
49
查看次数

使用jquery替换字符串的一部分

想要一些帮助用jquery替换字符串的一部分,所以这就是我所拥有的:

http://www.test.com/santa-cruz-island/?iframe=true&width=60%&height=70%
Run Code Online (Sandbox Code Playgroud)

我想直到最后替换所有内容?iframe=:

到目前为止我有这个:

jQuery('.islands_info_ggt').each(function() {
         url = jQuery(this).attr('href');
        _imgr = url.replace('iframe=', 'test');

    jQuery(this).attr('href', _imgr)
});
Run Code Online (Sandbox Code Playgroud)

结果: http://www.test.com/santa-cruz-island/?testtrue&width=60%&height=70%

这是我正在寻找的结果: http://www.test.com/santa-cruz-island/?test

regex jquery

0
推荐指数
1
解决办法
2635
查看次数

Echo foreach循环内部数组

我有以下代码,当我尝试$test_array使用类似"111 222"的空格打印下面数组中的值时:

$test_array= array('111', '222');


// output headers so that the file is downloaded rather than displayed
header('Content-Type: text/csv; charset=utf-8');
header('Cache-Control: no-store, no-cache'); 
header('Content-Disposition: attachment; filename=data.csv');


$output = fopen('php://output', 'w');


$test_data = array(  
    array('Invoice #', 'Name', 'Email'),  
    array( $test_array, 'John', 'test@yahoo.com')  
);


foreach( $test_data as $row )  
{  
   fputcsv($output, $row, ',', '"');     
}  

fclose($output);
Run Code Online (Sandbox Code Playgroud)

php

-4
推荐指数
1
解决办法
1130
查看次数

标签 统计

jquery ×1

mysql ×1

php ×1

regex ×1

sql ×1