We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the code as following:
package main import ( "database/sql" "fmt" _ "github.com/lib/pq" ) func main() { db, err := sql.Open("postgres", "user=postgres password=password dbname=mydb sslmode=disable") if err!= nil { panic(err) } defer db.Close() var username string fmt.Println("请输入用户名:") fmt.Scanln(&username) var query string = "SELECT * FROM users WHERE username = '" + username + "'" rows, err := db.Query(query) if err!= nil { panic(err) } defer rows.Close() // 处理查询结果 }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
the code as following:
The text was updated successfully, but these errors were encountered: