我现在正在导入我的csv,除了一件事,如何让导入忽略第一行中的数据?员工将上载第一行中具有列名称的相同格式.
if (isset($_POST['submit'])) {
if (is_uploaded_file($_FILES['filename']['tmp_name'])) {
echo "<h1>" . "File " . $_FILES['filename']['name'] . " uploaded successfully." . "</h1>";
echo "<h2>Displaying contents:</h2>";
readfile($_FILES['filename']['tmp_name']);
}
//Import uploaded file to Database
$handle = fopen($_FILES['filename']['tmp_name'], "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$import = "INSERT into tictoc(employee,taskname,tasktime,sessiontime,sessionstart,sessionend,sessionnotes) values('" . $userinfo['first_name'] . " " . $userinfo['last_name'] . "','$data[0]','$data[1]','$data[2]','$data[3]','$data[4]','$data[5]')";
mysql_query($import) or die(mysql_error());
}
fclose($handle);
print "Import done";
}
Run Code Online (Sandbox Code Playgroud) 我试图将一个项添加到kendoDropDownList,它似乎添加了选项但没有设置值和文本.检查选择它只是添加了一个新选项
<option></option>
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的
$("#nameList").data("kendoDropDownList")
.dataSource.add({ "text": "Joe", "value": "Joe" });
Run Code Online (Sandbox Code Playgroud)
UPDATE
这是我的数据源模型和requestEnd建议,但值似乎搞砸了
datasource_people = new kendo.data.DataSource({
type: "json",
serverFiltering: true,
transport: {
read: {
dataType: 'json',
type: 'GET',
url: '/restful/people/'
}
},
filter: {
field: "status",
operator: "eq",
value: 1
},
schema: {
data: function(response) {
return response.data.plaintiffs;
},
model: {
id: "person_id",
fields: {
person_id: {type: "number"},
name: { type: "string"}
}
},
errors: "error",
total: function(response) {
return response.data.total;
}
}
});
Run Code Online (Sandbox Code Playgroud)
然后是
$("#people_list").kendoDropDownList({
dataTextField: "text", …Run Code Online (Sandbox Code Playgroud) 我对DB的一个csv导入有一个字段值,看起来像'24h 30m'
我如何将这个分开两组数字?这是我到目前为止所拥有的
$tasktime = "24h 30m";
$pieces = explode("h ", $tasktime);
echo $pieces[0]; // want this to echo 24
echo $pieces[1]; // want this to echo 30
Run Code Online (Sandbox Code Playgroud) 我的sysntax怎么了,我无法做到.有没有更好的办法?
<?
$uid = $_GET["uid"];
$month= $_GET["month"];
$year = $_GET["year"];
$query = "SELECT taskname,uid,month,year, SUM(tasktime) FROM tictoc WHERE uid = $uid, month = $month, year = $year GROUP BY taskname";
$result = mysql_query($query) or die(mysql_error());
// Print out result
while($row = mysql_fetch_array($result)){
echo "<br />";
echo "Total ". $row['taskname']. " = <strong>". $row['SUM(tasktime)']."</strong>";
echo "<br />";
}
?>
Run Code Online (Sandbox Code Playgroud)
错误是:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right …Run Code Online (Sandbox Code Playgroud) 您好我多年没有使用过flash,需要在我的新AS3横幅中使用一些旧的跟踪代码.我注意到在3.0中,你不能将动作脚本放在对象本身上,只是在时间轴上.
我需要转换这个As2脚本,我通常会在标有"my_button"的按钮上进行转换
on (release) {
getURL (_level0.clickTag, "_blank");
}
Run Code Online (Sandbox Code Playgroud)
我的按钮标记为"my_button"的时间轴上使用的等效代码段是什么?
我试图让这个查询工作,但我不能正确的语法,有人可以帮忙吗?谢谢
$query="UPDATE users SET upsell2='" .$upsell2.
"' upsell1='" .$upsell1."' WHERE email='" .$email."'";
Run Code Online (Sandbox Code Playgroud) php ×4
mysql ×2
actionscript ×1
csv ×1
explode ×1
flash-cs5 ×1
javascript ×1
jquery ×1
kendo-ui ×1
sql ×1
syntax ×1
where-clause ×1