我有这个PHP开关:
<?php
$destination = isset($_GET['act']);
switch ($destination) {
default:
echo "test";
break;
case "manage":
echo "manage things";
break;
case "create":
echo "create things";
break;
}
?>
Run Code Online (Sandbox Code Playgroud)
然而,当我去test.php?act=create,输出manage things不是create things....当我去test.php?act=manage- 当然我得到manage things...
那么......我该如何解决这个问题呢?谢谢
在我的工作中,我有几个包含超过200,000行数据的表.我必须设置一些查询,一次超过15,000+,所以有时我会收到此错误:
PHP致命错误:超过180秒的最大执行时间
那么,我如何加快查询速度呢?
查询是这样的:
SELECT toemail, toname
FROM email_sent
WHERE companyid = '$member[companyid]'
Run Code Online (Sandbox Code Playgroud)
谢谢.
如何更改Java AWT List项的背景颜色?我指的是AWT列表中的单个项目,而不是整个事物.
我试图抓住一个异常,然后在JTextArea中显示它,但我得到null ...
这里是:
} catch (Exception rwe) {
// System.exit(0);
game.remove(yPanel);
game.remove(xPanel);
game.remove(roomPanel);
game.remove(userPanel);
game.remove(titlePanel);
game.remove(introPanel);
remove(game);
remove(sp);
remove(invOne);
remove(main);
remove(say);
add(statusPanel);
JTextArea errorText = new JTextArea();
errorText.append("Here is the reason why it crashed:\n" +rwe.getMessage());
errorText.setPreferredSize(new Dimension(500,300));
System.out.println("errorrr:" + rwe.getMessage());
statusPanel.add(errorText);
statusPanel.setOpaque(true);
labelStatus.setVisible(true);
System.out.println("Server crashed");
c.append("\nServer crashed...");
rwe.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
当一个错误发生时,我在JTextArea中得到它:
Here is the reason why it crashed:
null
Run Code Online (Sandbox Code Playgroud)
为什么?
有没有办法看看我的JList list是否被选中?
我这样说是因为我有一个JList和JTextfield,当我在JList中键入"F"来执行一个键事件动作时...字母F在我专注于它之后被输入到JTextField中.
例如:假设我转到JTextField并输入"hi".我回到我的JList并单击所选项目并按"F"从列表中删除...然后在JTextField中......即使我在JList上,我也会输入"F".
得到我说的话?
我用谷歌搜索和谷歌搜索,但没有得到任何地方或过时的教程.任何人都知道如何制作它,以便我可以使用Flash上的ActionScript 3使用按钮切换音频?
好吧,让我说我有一个textarea,我输入textarea
Hello my name is
Frank and I like
to eat apples.
Run Code Online (Sandbox Code Playgroud)
然后,当我按下提交按钮时,我得到:
[Hello my name is]
[Frank and I like]
[to eat apples.]
Run Code Online (Sandbox Code Playgroud)
查看每个行如何在开头和结尾附加括号?
你有没有办法在PHP中做到这一点?
假设我有这些怪物(已经配置了他们的名字,攻击,等级,exp等)但是什么是跟踪他们的X和Y的好方法?
也许是ArrayList<>?喜欢添加那个arraylist 1|12|8|3,其中1是Monster的ID(以后用作m 1.gif,12是X,8是Y,3是地图编号.
您认为在Java中将怪物存储在地图中的好方法是什么?
我正在尝试使用此获取图像SRC: var SRCNow = $('#'+ID+'.item').attr("src");
对此:
<a id='17' href='#' name='item' class='tilelink'><img title='17' id='17' style='background:red'; class='item' src='line_tile/t17.png' /></a>
Run Code Online (Sandbox Code Playgroud)
所以当我点击图片点击图片时......: var ID = $(this).attr("id");
然后我做了alert(SRCNow);,我得到了不确定......当它应该说SRC.
可能重复:
将ereg表达式转换为preg
我试图转换,但我一直在失败.
我的ereg: if (!ereg("^[a-zA-Z0-9]{3,16}$",$username)) {
是错的,因为它已经过时了.我该如何切换到preg_match?