我无法在函数中使用mysql查询.我不明白为什么会这样:
$datetime = date('m/d/Y h:i:s a', time());
$query = "INSERT INTO 1_posts (title_post, time_post, key_words_post, content_post) VALUES ('$title2', '$datetime', '$keywords2', '$text2')";
mysql_query($query, $con);
Run Code Online (Sandbox Code Playgroud)
但这不是:
function insert_post($title2, $keywords2, $text2)
{
$datetime = date('m/d/Y h:i:s a', time());
$query = "INSERT INTO 1_posts (title_post, time_post, key_words_post, content_post) VALUES ('$title2', '$datetime', '$keywords2', '$text2')";
mysql_query($query, $con);
}
Run Code Online (Sandbox Code Playgroud)
当然,我有一个与db的连接,我正在调用该函数.我尝试用一些回声调试,我发现该函数停止了ant mysql_query,但我不明白为什么.
当用户将鼠标悬停在我的div上时,我希望我的背景图像从.1不透明度增加到.5不透明度.
HTML
<div id="list">
<div class="line_one">om nom nom nom...</div>
<div class="line_two">18 foods to make you incredibly hungry</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
#list {
display:block;
position: relative;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
#list::after {
content: "";
background: url('test.jpg');
opacity: 0.1;
top: 0;
left: 0;
bottom: 0;
right: 0;
position: absolute;
z-index: -1;
}
Run Code Online (Sandbox Code Playgroud)
必须有一种方法可以在没有Javascript的情况下完成此操作.有任何想法吗?
如何在golang中列出包的公共方法?
main.go
package main
func main() {
// list all public methods in here
}
Run Code Online (Sandbox Code Playgroud)
库/ method.go
package libs
func Resut1() {
fmt.Println("method Result1")
}
func Resut2() {
fmt.Println("method Result2")
}
Run Code Online (Sandbox Code Playgroud)