package main
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
"log"
)
func main() {
db, err := sql.Open("mysql", "tcp(127.0.0.1:9312)/")
if err != nil {
log.Fatal(fmt.Errorf("open connection: %v", err))
}
defer db.Close()
res, err := db.Query("SELECT * FROM catalogue WHERE (@title тест) | (@tags тест)")
if err != nil {
log.Fatal(fmt.Errorf("query: %v", err))
}
fmt.Println(res)
}
2020/03/04 12:23:59 query: commands out of sync. Did you run multiple statements at once?
exit status 1