我有这个:
$scCost = $row["gpsc"];
mysql_query("
UPDATE member_profile
SET points = points-$scCost
WHERE user_id = '".mysql_real_escape_string($userid)."'
") or die(mysql_error());
Run Code Online (Sandbox Code Playgroud)
这需要用户点 - scCost.
我如何检查用户是否负担得起?所以,如果用户有30并且$ scCost是40 ..
请检查一下:
http://img62.imageshack.us/img62/3598/ieff.png
为什么它比FF更高...我希望它在IE中像FF一样
#message2 {
position: absolute;
top: 0;
left: 0;
z-index: 105;
background-color: #034678;
font-family: Arial,Helvetica,sans-serif;
font-size: 100%;
text-align: center;
font-weight: bold;
border-bottom: 2px solid #FFF;
height: 26px;
width: 100%;
}
<div class="message2" id="message2" onclick="closeNotice2()" style="display: none">
Yo, <b><? echo $pusername; ?></b> - <? echo $_SESSION["user_message"]; ?>
<a class="close-notify" onclick="closeNotice2()">X</a>
</div>
Run Code Online (Sandbox Code Playgroud)
当我改变高度的大小时,它在FF中改变但在IE中它保持相同的大小..?
所以我在html/css/js中有这个下拉列表..它在鼠标悬停时向下滑动,但是现在它向下滑动错误,我的意思是它将我的文本向下移动,我不想让它做...我希望它像浮动在它上面所以文本在菜单后面
左边是它的样子,右边是鼠标悬停的时候.正如你可以看到"示例我"文本我不希望它向下移动,我希望菜单像浮在上面所以当你再次移开鼠标时你可以看到"示例我"
这是菜单的css:
.menu_class {
border:1px solid #1c1c1c;
}
.the_menu {
display:none;
width:150px;
border: 1px solid #1c1c1c;
}
.the_menu li {
background-color: #283d44;
}
.the_menu li a {
color:#FFFFFF;
text-decoration:none;
padding:10px;
display:block;
}
.the_menu li a:hover {
padding:10px;
font-weight:bold;
color: #fffc30;
}
<img src="images/button.png" width="126" height="23" class="menu_class">
<ul class="the_menu">
<li><a href="#">Profil</a></li>
</ul>
Run Code Online (Sandbox Code Playgroud)
if($timestamp > time() - 60){
// Count seconds ago
$deff = time() - $timestamp;
$seconds = $deff / 60;
echo intval($seconds)." seconds ago";
} elseif($timestamp > time() - 3600){
// Count minutes ago
$deff = time() - $timestamp;
$minuts = $deff / 60;
echo intval($minuts)." minutes ago";
}
Run Code Online (Sandbox Code Playgroud)
我认为分钟前是对的,但不是秒?我应该怎么做"秒前"吧?
基本上它只是:
success: function(msg){
alert(msg);
}
Run Code Online (Sandbox Code Playgroud)
什么出来警报.但是,如果我在ajax调用的文件中有一个var,我是否有可能:
$filename = time() . "10";
Run Code Online (Sandbox Code Playgroud)
成功使用?
所以我能做到
success: function(msg){
alert($filename);
}
Run Code Online (Sandbox Code Playgroud)
(现在它不正确)但我怎么能这样做?
$.ajax({
type: "POST",
url:"functions.php?action=crop",
data: {x: $('#x').val(),y: $('#y').val(),w: $('#w').val(),h: $('#h').val(),fname:$('#fname').val(),fixed:fixed,size:size},
success: function(msg){
if(!fixed)
$("#crop_preview").css({overflow:"auto"})
$("#crop_preview").html($(document.createElement("img")).attr("src", msg.filename)).show();
$("#crop_preview").after("Here is your Cropped Image :)").show();
$("#image").slideUp();
}
});
Run Code Online (Sandbox Code Playgroud)
和PHP:
$time = time().".jpg";
echo '(';
echo json_encode(array(
'filename'=>$time
));
echo ')';
Run Code Online (Sandbox Code Playgroud) 许多人建议我将名字和姓氏分开而不是"full_name"中的所有内容,如何将它们分隔到每个变量中,所以如果为你的例子输入字段:"Dude Jackson"然后"Dude"获得$ firstname和杰克逊在$姓.
是的,当我尝试在之前看起来像这样的变量上使用bindvalues时,我遇到了问题:
users.firstname LIKE '$firstname%'
Run Code Online (Sandbox Code Playgroud)
现在它看起来像这样:
users.firstname LIKE ':firstname%'
Run Code Online (Sandbox Code Playgroud)
但它不起作用,也试过这个:
users.firstname LIKE :firstname%
Run Code Online (Sandbox Code Playgroud)
并得到一些语法错误..
对此有什么正确的解决方案?我还想在bindValue中添加%(:firstname,$ firstname%),但我还需要在其他地方使用:firstname,不应该有%..
谢谢你
INSERT INTO users (firstname, lastname, email, mobile) VALUES ('Karem', 'Parem', 'mail@mail.com', '123456789');
Run Code Online (Sandbox Code Playgroud)
这就是我想要做的,但是如果mail@mail.com已经存在具有相同电子邮件的行,那么它应该使用这些值更新该行.
我找到了http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html,但我不明白
->where('orders.date_paid', 'BETWEEN', array($from, $to))
->and_where('orders.status', '=', 'new')
->or_where('orders.status', '=', 'delivered')
Run Code Online (Sandbox Code Playgroud)
我想显示date_paid介于$ from和$ to之间的所有行,其中status是new或deliver.
当我添加这个or_where()时,它会忽略BETWEEN $ from和$ to date_paid where子句.
我怎么能这样做?
我在表"食谱"中有一列名为"产品".这是这样的:
460,450|50,100|243,500|141,5|457,100|383,211|
Run Code Online (Sandbox Code Playgroud)
产品ID,ProductGrams | 是格式.
现在我想在上面的例子中搜索id为243的产品.我怎样才能做到这一点?
SELECT * FROM recipes WHERE Products LIKE '%243%'
Run Code Online (Sandbox Code Playgroud)
如果theres productgrams是243,也会给我结果.
我怎样才能做到这一点?我迷路了...
如果theres也php解决这个问题,那就没关系.