小编Bub*_*les的帖子

mysql_query在自定义php函数中不起作用

我无法在函数中使用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,但我不明白为什么.

php mysql

2
推荐指数
1
解决办法
460
查看次数

悬停时增加透明背景不透明度?

当用户将鼠标悬停在我的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的情况下完成此操作.有任何想法吗?

html css opacity

2
推荐指数
1
解决办法
8413
查看次数

如何在golang中列出包的公共方法

如何在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)

reflection go

2
推荐指数
1
解决办法
3988
查看次数

标签 统计

css ×1

go ×1

html ×1

mysql ×1

opacity ×1

php ×1

reflection ×1