在我使用union的sql中我不知道如何在zend db中编写它.
select m.*, 0 as is_shared from test m where user_id = $userId
union
select m.*,1 as is_shared from test m
join test_shares ms
where m.test_id = ms.test_id
and ms.email_address = $email
and m.url is not null;
Run Code Online (Sandbox Code Playgroud)
请帮帮我....
我试过这样但没用
$cols1 = array('test.*,0 as is_shared');
$select1 = $db->select ()
->from ( 'test', $cols1 )
->where ( 'user_id = ?', $userId);
$cols2 = array('test_shares.*', '1 as is_shared');
$select2 = $db->select ()
->from ( 'test', $cols2 )
->join ( 'test_shares', array () …Run Code Online (Sandbox Code Playgroud) 第一个问题:
当用户删除特定行时,我必须仅删除该行而不刷新页面。使用ajax删除行。我怎样才能做到这一点
第二个问题: 实际上我正在计算从当天到前 7 天的页面点击次数。但我想当今天页面点击时我必须检索上周的意思是从星期日(2011年11月20日)到星期六(2011年11月20日)当页面在下周一点击时所以我必须检索本周的记录意思是从星期日(2011年11月27日)至星期六(2011 年 12 月 3 日)
function authenticate(){
$.ajax({
type: "POST",
url: "authentication.php",
data: $("#login_form").serialize(),
success: function(msg){
if(msg==1){
$('#delete').html("success"); //if success message appear only i have to remove particular row
})
}else{
$('#delete').html("error");
}
},
error:function(msg){
alert(msg);
$('#delete').dialog("close");
}
});
}
<div style='display: none;' id='delete'></div>
<table border="1">
<tr>
<th>Title</th>
<th>Public Id</th>
<th>Pass</th>
<th></th>
</tr>
<?php
$select = $db->select ()
->from ( 'test', '*' )
->where ( 'user_id = ?', 1 )
->where ( 'test.created > …Run Code Online (Sandbox Code Playgroud) 如果array(0)是null php,如何忽略
当我打印值时,数组是这样的:Array([0] =>)
如果我打印计数($ testArray)它显示1
但如果数组值是这样的,我不想将其插入数据库.请建议我该怎么做.
更新:
var_dump result:array(1){[0] => string(0)""}