我正在开发可以处理多个数据库服务器的应用程序,如"MySQL"和"MS SQL Server".
我想使用适用于所有数据库类型的通用查询来获取特定数据库的表名.我试过以下:
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'
Run Code Online (Sandbox Code Playgroud)
但它给出了特定服务器的所有数据库的表名,但我想获取所选数据库的表名.如何限制此查询以获取特定数据库的表?
我想在我的网站上显示条款和条件备注.我不想使用文本字段,也不想使用我的整个页面.我只想在选定区域显示我的文本,并且只想使用垂直滚动条向下阅读所有文本.
目前我正在使用此代码:
<div style="width:10;height:10;overflow:scroll" >
text text text text text text text text text
text text text text text text text text text
text text text text text text text text text
text text text text text text text text text
text text text text text text text text text
text text text text text text text text text
text text text text text text text text text
text text text text text text text text text
</div>
Run Code Online (Sandbox Code Playgroud)
两个问题:
可能重复:
如何列出SQL Server表的主键?
我想使用SQL查询SQL Server数据库获取特定表的主键.
在MySQL中我使用以下查询来获取表主键:
SHOW KEYS FROM tablename WHERE Key_name = 'PRIMARY'
Run Code Online (Sandbox Code Playgroud)
什么相当于上面的SQL Server查询?
如果有一个查询适用于MySQL和SQL Server,那么它将是一个理想的情况.
我有两个像这样的数组:
array(
'11' => '11',
'22' => '22',
'33' => '33',
'44' => '44'
);
array(
'44' => '44',
'55' => '55',
'66' => '66',
'77' => '77'
);
Run Code Online (Sandbox Code Playgroud)
我想组合这两个数组,使它不包含重复,并保留其原始键.例如输出应该是:
array(
'11' => '11',
'22' => '22',
'33' => '33',
'44' => '44',
'55' => '55',
'66' => '66',
'77' => '77'
);
Run Code Online (Sandbox Code Playgroud)
我试过这个,但它正在更改原来的密钥:
$output = array_unique( array_merge( $array1 , $array2 ) );
Run Code Online (Sandbox Code Playgroud)
有解决方案吗
我有两个这样的形式:
<form id='form1' name='form1'>
<input name='name' id='name'>
<input name='name2' id='name2'>
</form>
<form id='form2' name='form2'>
<input name='name' id='name'>
<input name='name2' id='name2'>
</form>
Run Code Online (Sandbox Code Playgroud)
现在我想在form2的name字段中插入文本.我使用以下jQuery代码,但它填写form1的名称字段.
$("#name").val('Hello World!');
Run Code Online (Sandbox Code Playgroud)
那么如何只选择特定的表单元素呢?
我尝试了一些解决方案,但我无法获得确切的名称和版本:
我正在尝试以下代码:
$browserAgent = $_SERVER['HTTP_USER_AGENT'];
echo $browserAgent;
Run Code Online (Sandbox Code Playgroud)
上述代码的输出:
Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24
Run Code Online (Sandbox Code Playgroud)
但我正在使用:
Google Chrome 11.0.696.68
on
Ubuntu 10.04
Run Code Online (Sandbox Code Playgroud)
所以我可以Chrome/11.0.696.68
在输出字符串中找到它,但它也显示了一些其他浏览器名称,这些名称很难从字符串中提取确切的浏览器名称/版本.
当我在浏览器中使用以下URL时,它会提示我下载带有JSOn内容的文本文件.
https://chart.googleapis.com/chart?cht=p3&chs=250x100&chd=t:60,40&chl=Hello|World&chof=json
(点击上面的URL查看下载的文件内容)
现在我想创建一个php页面.我希望当我调用这个php页面时,它应该调用上面的URL并从文件中获取内容(json格式)并在屏幕上显示它.
我怎样才能做到这一点 ??
我使用以下代码,它成功上传本地计算机上的文件.它在我的本地计算机上显示"已成功上传".
// Upload file
$moved = move_uploaded_file($_FILES["file"]["tmp_name"], "images/" . "myFile.txt" );
if( $moved ) {
echo "Successfully uploaded";
} else {
echo "Not uploaded";
}
Run Code Online (Sandbox Code Playgroud)
但是,当我在我的在线服务器上使用此代码时,它不上传文件,只显示消息"未上传".
我怎么知道问题是什么?如何才能将实际问题显示给用户?
我在Windows XP上使用wamp server 2.0.每当我创建一个名称中包含一些大写的表时,它就会转换为小写.
例如:
I create: UserInfo
phpmyadmin convert it to: userinfo
Run Code Online (Sandbox Code Playgroud)
我在办公室使用ubuntu/phpmyadmin,但这个问题确实存在.
从哪里可以解决这个问题.谢谢
我在ubuntu上下载了eclipse.但是当我运行它时会显示以下错误.
A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
/home/awan/eclipse/jre/bin/java
java in your current PATH
Run Code Online (Sandbox Code Playgroud)
有人可以帮我解决这个问题.我在ubuntu上没有这方面的经验.
谢谢
php ×4
jquery ×2
sql ×2
sql-server ×2
arrays ×1
browser ×1
css ×1
eclipse ×1
file ×1
file-upload ×1
html ×1
java ×1
javascript ×1
mysql ×1
overflow ×1
phpmyadmin ×1
ubuntu ×1
unique ×1
url ×1
wampserver ×1