而不是一次检查一个表单中的所有我的帖子变量有没有办法运行一个检查至少验证他们不是空的像
if(!isset(ALL $_POST)){
echo "one of your fields is not completed.";
}
Run Code Online (Sandbox Code Playgroud) 只是尝试将类添加到当前页面的菜单项,以便用户知道他们当前所在的页面.但背景图像不会显示.我正在申请上课,<a>但我也把它添加到了<li>
<div id="menu">
<ul id='foot'>
<li><a class="current" href='index.php'>Home</a></li>
<li><a href='article-list.php?article_type=test0'>Page 0</a></li>
<li><a href='article-list.php?article_type=test'>Page 1</a></li>
<li><a href='article-list.php?article_type=test2'>Page 2</a></li>
<li><a href='chic.php?page=blogs_full'>Page 3</a></li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
样式表:
#menu{height:51px;width:900px;background-image:url(../NEW_images/menu_bg.jpg);background-repeat:repeat-x;}
#menu ul{}
#menu li {display:inline;font: 20px Verdana, Helvetica, sans-serif;margin: 0;padding: 0;}
#menu a {background: url("../images/seperator.gif") bottom right no-repeat;color: #ccc;display: block;float: left;margin: 0;padding: 8px 20px;text-decoration: none;}
#menu a:hover {background: #2580a2 url("../NEW_images/li_bg.jpg") bottom center repeat-x;color: #fff;padding-bottom: 8px;padding: 8px 20px;}
.current{background: #2580a2 url(../NEW_images/li_bg.jpg) bottom center repeat-x;color: #fff;padding-bottom: 8px;padding: 8px 20px;}
#page_num{width:100%; text-align:center; margin:40px 0 20px 0;}
Run Code Online (Sandbox Code Playgroud) 希望我在这里遗漏一些简单的东西:
$sql = "Select * FROM user_info, user_login WHERE user_login.status = '0' OR user_login.status = '2' AND user_info.uid = user_login.uid";
$db = new connection();
$results = $db->query($sql);
$user = array();
while($info = mysql_fetch_array($results))
{
$user[] = $info;
}
$total = count($user);
//TEST the amount of rows returned.
echo $total;
for ($i = 0; $i < $total; $i++)
{
//echo data;
}
Run Code Online (Sandbox Code Playgroud)
只是尝试将user_login.status字段设置为"0"或"2"的所有数据拉出来,但它显示了所有内容,并显示标记为2的项目两次.有谁看到我的问题?
如何使用我的新阵列更新ArrayAdapter?
Belwo是我的ArrayAdapter,添加了一个默认数组.
String[] array_spinner = new String[]{"Select your state."};
ArrayAdapter<String> adapter = new ArrayAdapter<String> (this,android.R.layout.simple_spinner_item,array_spinner);
adapter.setDropDownViewResource(R.layout.state_spinner_layout);
Myspinner.setAdapter(adapter);
Run Code Online (Sandbox Code Playgroud)
现在我加载一些JSON数据来解析信息array_spinner_data,我想调用notifyDataSetChanged()
array_spinner = new String[]jsonArray.length();
for (int i=0; i<jsonArray.length(); i++)
{
String styleValue = jsonArray.getJSONArray(i).getString(0);
Log.d(TAG, styleValue);
array_spinner[i] = styleValue;
}
Log.d(TAG, String.valueOf(array_spinner.length));
adapter.notifyDataSetChanged();
Run Code Online (Sandbox Code Playgroud)
我没有看到任何错误,我的所有Log.d都应该回来了.但是当我点击我的微调器时,所有显示的都是原始的,Select your state 我遗漏了一些基本的onCreate和Json加载的东西,但如果有人需要看到它只是让我知道.
<editText>当用户关注该文本框时,如何删除您指定的默认文本?
我发现下面的代码看起来应该可以工作但是当我点击文本框时,我仍然需要在键入新文本之前删除默认文本.
final EditText RemoveZipField = (EditText) findViewById(R.id.zipcode);
RemoveZipField.setOnFocusChangeListener(new OnFocusChangeListener()
{
@Override
public void onFocusChange(View v, boolean hasFocus)
{
if (hasFocus==true)
{
if (RemoveZipField.getText().toString().compareTo("Zipcode")==0)
{
String inText = "I AM IN";
Log.d(TAG, inText);
RemoveZipField.setText("");
}else{
String outText = "I AM OUT";
Log.d(TAG, outText);
}
}
}
});
Run Code Online (Sandbox Code Playgroud) 我可以在mysql语句中使用"OR"来检查多个选项的字段值吗?
//THE QUESTION IF HAVE IS HOW DO I DO SOMETHING LIKE BELOW MAINLY THE "1 OR 2 OR 3 OR 4" PART.
$sql = "SELECT email FROM USER_INFO WHERE storeID = '$storeNUM' AND region = '1 OR 2 OR 3 OR 4'";
$results2 = $db->query($sql);
Run Code Online (Sandbox Code Playgroud) 我从来没有像以下那样在android中构建数组,我认为我的语法有错误.
我试图完成某些事情,如:
String RoomName[] = {"145"="PentHouse","125"="BoardRoom","45"="ShopRoom","8"="MainOffice"};
Run Code Online (Sandbox Code Playgroud)
所以如果我引用类似的东西:
String CurrentRoom = RoomName["8"];
Run Code Online (Sandbox Code Playgroud)
我希望CurrentRoom等于MainOffice.
我知道我错过了一些明显的东西.
我试图在我的平板电脑上创建一个"热点",就像一个按钮,但用户看不到按钮.当我尝试以下操作时,我有一个按钮但是当可见性设置为"4"时,用户无法进行交互或看到它:
Button b=(Button)findViewById(R.id.b);
b.setOnClickListener(listener);
b.setVisibility(4);
public OnClickListener listener=new OnClickListener(){
public void onClick(View arg0) {
Intent myIntent = new Intent(MeetingManager.this,GetRoom.class);
startActivityForResult(myIntent, 0);
}
};
Run Code Online (Sandbox Code Playgroud)
我有什么想法可以达到上述要求吗?
我看到了类似的帖子,但不完全是我要完成的任务。
我要做的就是将当前日期和时间保存在一个可以添加到数据库表的变量中。但是,当表单提交时,出现500 Server页面错误
下面是我到目前为止的代码:
<cfif isDefined("FORM.submit") AND #FORM.submit# IS NOT "">
<cfoutput>
<cfset var submit_date = #DateFormat(Now(),"mm/dd/yy - HH:mm:ss")#>
<cfquery name="InsertSuggestion" datasource="MainDB">
INSERT INTO Suggestion_Form (Submission_Date,Submission_Content)
VALUES ('#submit_date#','#FORM.suggestion_text#')
</cfquery>
</cfoutput>
<div style="text-align:center;width:100%;">We value your feedback. Your request has been recieved.</div>
<cfelse>
Run Code Online (Sandbox Code Playgroud) 在ColdFusion中工作时,如何从最近的查询中返回主键ID值?
例如:
<cffunction name="addAction" access="public" returntype="string">
<cfquery name="newAction" datasource="RC">
INSERT INTO myTable (name,address,title) VALUE (#fname#,#address#,#usrtitle#);
</cfquery>
<cfset actionUpdateID = #result_name.IDENTITYCOL#>
<cfreturn actionUpdate>
</cffunction>
Run Code Online (Sandbox Code Playgroud)
在上面的示例中,我试图actionUpdate返回主键的值,该主键是一个名为的列ID.