我的数据库中有以下数据:
|NO | model | date |
+---+-------+----------+
|1 | bee |2011-12-01|
|2 | bee |2011-12-05|
|3 | bee |2011-12-12|
|4 | tar |2011-12-13|
Run Code Online (Sandbox Code Playgroud)
我想获得每个模型组的最新日期:
| model | date |
+-------+----------+
| bee |2011-12-12|
| tar |2011-12-13|
Run Code Online (Sandbox Code Playgroud)
我试过了:
SELECT model, date
FROM doc
WHERE date ........????? //what is the next?
GROUP BY model
Run Code Online (Sandbox Code Playgroud) 我在打开旧网站时遇到了一些问题.我的数据表显示:
DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.
Run Code Online (Sandbox Code Playgroud)
之后,我尝试调试我的脚本并在mysql中发现错误:
Error occuered during query execution:
(<small>SELECT SQL_CALC_FOUND_ROWS ID,name,remark,avrusepmonth
, CONCAT('<input type=''checkbox''id=''cb' , ID ,''' name=''check[]''
value=''',ID,''' >','<label class=''lbcb'' for=''cb',
ID,'''><=update=</label>') as checkb
,monthavrage(ID,12) as latestavr , moq, leadtime
FROM test_media WHERE nowuse=1 and monthavrage(ID,12) > 0 ORDER BY name
desc, ID
LIMIT 0, 10</small>):
execute command denied to user 'jeinqa'@'localhost' for routine 'TestMediaControl.monthavrage'
Run Code Online (Sandbox Code Playgroud)
然后我试着去谷歌搜索execute command denied to user 'jeinqa'@'localhost' …
我包括文件inner.php
中outer.php
,我有一个条件中inner.php
上,我想停止执行inner.php
,但不是全部的脚本,即我要跳到第一线outer.php
列入后inner.php
,我不想换所有的inner.php
if语句中的代码.
有没有办法这样做呢?
我有一些简单的查询:
SELECT foo, bar FROM table
Run Code Online (Sandbox Code Playgroud)
我想你现在的结果是什么样的.
我想要做的是根据查询结果中显示的数据显示一些序列号.它就像AUTO_INCREMENT
(它不是我想要显示ID).结果我想要的是:
|No| foo | bar |
-------------------------
|1 | bla | 123 |
|2 | boo | abc |
|3 | wow | xxx |
Run Code Online (Sandbox Code Playgroud)
我该怎么做呢?
提前致谢
在尝试将提交和上传组合在一个表单中时,我在上传时遇到问题但是对于提交表单没有问题.
JQuery + Ajax:
$("#oqcsubmit").click(function() {
if($("#oqc").valid()) {
var params=$("#oqc").serialize();
$.ajax({
type:"post",
url:"doinput.php",
data:params,
cache :false,
async :false,
success : function() {
$(".dt").val("");
$(".stat").val("");
return this;
},
error : function() {
alert("Data failed to input.");
}
});
return false;
}
});
<form id="oqc" enctype="multipart/form-data" >
<input type="text" id="mod" name="mod" class="dt"/>
<input type="text" id="no" name="no" class="dt"/>
<input id="filename" name="uploadedfile" type="file" />
<input type="submit" id="oqcsubmit" value="Submit" />
<input type="hidden" name="action" value="oqcdata" />
</form>
Run Code Online (Sandbox Code Playgroud)
PHP:
$dbc=mysql_connect(_SRV,_ACCID,_PWD) or die(_ERROR15.": ".mysql_error());
$db=mysql_select_db("QPL",$dbc) or die(_ERROR17.": ".mysql_error()); …
Run Code Online (Sandbox Code Playgroud) 我想在div中加载另一个php或html文件。我应该使用.load()
还是.html()
?有什么不同?
你能告诉我 chrome 支持什么样的文件吗?我有一些 .tif 文件格式可以显示在我的网页中。但是该文件或图像无法出现在我的网页中。
对我有什么建议吗?任何提前将不胜感激。谢谢。
我有这个错误:
Error message is :: "Error occured during query execution: (LOAD DATA LOCAL INFILE '/tmp/3sch.jofcial.txtgymCN5' REPLACE INTO TABLE `prod_sch` FIELDS TERMINATED BY ',' IGNORE 1 LINES (No_ ,Model_Code,Model_Name ,Lot_No_ ,Start_Seq_No_ ,Quantity ,Lot_Quantity ,Line_Code ,Line_Name ,@var10, Shift_No1,@var12,Shift_No2,@var14,Production_Mngm_Type,Model_Group,Model_Category,Actual_Results,MPS_Mngm_Code, Production_Mngm_Code,Comment) SET Production_Start_Date=STR_TO_DATE(@var10,'%m/%d/%Y'), Production_Finish_Date=STR_TO_DATE(@var12,'%m/%d/%Y'), Due_date=STR_TO_DATE(@var14,'%m/%d/%Y')): The used command is not allowed with this MySQL version";
Run Code Online (Sandbox Code Playgroud)
尝试这种语法后:
$temp_file = tempnam(sys_get_temp_dir(), '3sch.jofcial.txt'); // make temporary file name
$fp = fopen($temp_file, "wb"); // open temprary file
if (!$fp) die(_ERROR14);
fwrite($fp, $httpfile); // copy to temporary file from …
Run Code Online (Sandbox Code Playgroud) 如果值太长,我的数据表的列看起来更宽。
aTable = $("#printdata").dataTable({
"bAutoWidth" : false,
"bRetrieve" : true,
"scrollY": 200,
"scrollX": true,
"deferRender": true,
"scroller": {
loadingIndicator: true
},
"bServerSide": true,
"bProcessing": true,
"sAjaxSource": 'show2ndsampling.php',
"fnServerData": function (sSource,aoData,fnCallback){
$.ajax({
"dataType":'json',
"type":'POST',
"url":sSource,
"data":aoData,
"success":function(json){
fnCallback(json);
}
});
},
"order" : [[1,"desc"]],
"aoColumns" : [
/*serial*/{ "width": "30%", target : 3 }
]
Run Code Online (Sandbox Code Playgroud)
但是我的数据表没有变化。
由于我是jqGrid中的新手,我对此问题非常困惑.我的数据只显示10行.这是我的剧本;
jQuery("#list").jqGrid({
url:'dounfinish.php?q=1',
datatype: 'json',
mtype: 'POST',
closeafteredit:true,
colNames:['id','Date', 'Line','Model','Lotno','Qty','PIC'],
colModel :[
{name:'id', index:'id', hidden:true, width:55},
{name:'Date', index:'Date', width:90, editable:true, search:true, stype:'text',searchoption:{sopt:['cn']}},
{name:'Line', index:'Line', width:80, editable:true, search:true, stype:'text',searchoptions:{sopt:['cn']}},
{name:'Model', index:'Model', width:180, editable:true, search:true, stype:'text',searchoption:{sopt:['cn']}},
{name:'Lotno', index:'Lotno', width:80, editable:true, search:true, stype:'text',searchoption:{sopt:['cn']}},
{name:'Qty', index:'Qty', width:80, editable:true, search:true, stype:'text',searchoptions:{sopt:['cn']}},
{name:'PIC', index:'PIC', width:180, editable:true, search:true, stype:'text',searchoption:{sopt:['cn']}}
],
// pager: jQuery('#pager'),
gridview:true,
pager: '#pager',
width: '100%',
height: '100%',
rowNum:10,
rowList:[10,20,30],
sortname: 'Date',
sortorder: "desc",
viewrecords: true,
loadonce: true,
// imgpath: 'themes/basic/images',
caption: 'DAILY CHECK QTY', …
Run Code Online (Sandbox Code Playgroud)