查询结果的表名
当查询结果存在时,我想知道具有正确结果的行的名称:
$query = "SELECT Id FROM Programacao WHERE ID = 1";
$curDate = date("Y-m-d H").':00:00';
$query = "SELECT Id
FROM Programacao
WHERE Data1 = '$curDate'
OR Data2 = '$curDate'
OR Data3 = '$curDate'"
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)){}
只需谈论其 if(Data1 == curDate)return Data1; if(Data2 == curDate)return Data2
...
抱歉我的英语不好。
When the result of a query exists, I want to know the name of the row(s) that have the correct results:
$query = "SELECT Id FROM Programacao WHERE ID = 1";
$curDate = date("Y-m-d H").':00:00';
$query = "SELECT Id
FROM Programacao
WHERE Data1 = '$curDate'
OR Data2 = '$curDate'
OR Data3 = '$curDate'"
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)){}
simply talking its if(Data1 == curDate)return Data1; if(Data2 == curDate)return Data2
....
Sorry for my bad english.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
那么,您的查询将是
Programacao
。但如果你动态需要它,你可以尝试像mysql_table_name 这样的函数()
或mysql_field_name ()
。Well it would be
Programacao
from your query. But if you needed it dynamically you could try functions likemysql_table_name()
ormysql_field_name()
.select 语句不进入表。
它进入结果集。
结果集没有名称,但它们就是有名称。
http://en.wikipedia.org/wiki/Result_set
A select statement does not go into a table.
It goes into a resultset.
Resultsets do not have names, they just are.
http://en.wikipedia.org/wiki/Result_set
也许你的意思是这个? (使用
UNION
或UNION ALL
):Perhaps you mean this? (either with
UNION
orUNION ALL
):