当我运行这个时,我收到一个错误'未声明的变量:temp'
<?php
$maketemp = "CREATE TEMPORARY TABLE temp(`itineraryId` int NOT NULL, `live` varchar(1), `shipCode` varchar(10), `description` text, `duration` varchar(10), PRIMARY KEY(itineraryId))";
mysql_query( $maketemp, $connection ) or die ( "Sql error : " . mysql_error ( ) );
$inserttemp = "SELECT live, id AS itineraryId, ship AS shipCode, description AS description, duration AS length FROM cruises WHERE live ='Y' INTO temp";
mysql_query( $inserttemp, $connection ) or die ( "Sql error : " . mysql_error ( ) );
$select = "SELECT intineraryId, …Run Code Online (Sandbox Code Playgroud) 好吧现在我的滑动打开ul显示所有列表元素,现在我想要点击的标题栏添加一个选定状态,然后在关闭时删除该状态...
UL上面的div有一个.regionHeader类
这是标记的一个例子
<div class="regionHeader">title of the region</div>
<ul class="region"><li>the region i'm hiding/showing</li></ul>
Run Code Online (Sandbox Code Playgroud)
这是javascript
var stockists = {
start: function() {
$('.region').hide();
$('.regionTitle').each(function(){
$(this).click(function(e){
e.preventDefault();
$(this).parent().next('.region').slideToggle(300);
});
});
}
};
$(stockists.start);
Run Code Online (Sandbox Code Playgroud)
我一直在尝试addClass,但它似乎只是添加类而不是删除它?
我正在运行这个查询,它正在填充我的临时表,然后我从中导出.priceSingle是通过简单地加倍票价来计算的.但是,对于某些行,该类别无论如何都是单一票价,所以我不想加倍.该查询实际上嵌入在PHP中的字符串中,但SQL看起来像:
INSERT INTO temp
SELECT cruises.code AS sailingId, live, 'USD', 'optioncode', 'rateOptionName', '2',
category AS cabinCategory, fare*2 AS priceSingle, fare AS priceDouble,
supplements_usa.adult AS priceAdditional
FROM fares_usa, supplements_usa, cruises
WHERE fares_usa.cruise_id = supplements_usa.cruise_id
AND cruises.id = fares_usa.cruise_id AND cruises.live = 'Y'
Run Code Online (Sandbox Code Playgroud)
fare*2当category等于5或10 时,我怎么能避免做?
我有一个简单的插入记录,用于将项添加到记录集.价格的数据字段设置为十进制,当价格字段发送时,例如9.50,它在数据库中显示为9.00.为什么?
这是php insert语句中的代码
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO buying (`user`, items, price) VALUES (%s, %s, %s)",
GetSQLValueString($_POST['user'], "text"),
GetSQLValueString($_POST['items'], "int"),
GetSQLValueString($_POST['price'], "int"));
Run Code Online (Sandbox Code Playgroud)