Answer the question
In order to leave comments, you need to log in
How to solve query problem in mysql golang?
Hello, I've been struggling with this problem for a day now.
Connecting to Mysql database
db, err := sql.Open("mysql", "user:[email protected]/dbname")
defer db.Close()
if err != nil {
panic(err)
}
key := 1545
var user_key string
err = db.QueryRow("SELECT * FROM users WHERE user_key=?", key).Scan(&user_key)
switch {
case err == sql.ErrNoRows:
log.Printf("No user with that key.")
case err != nil:
log.Fatal(err)
default:
fmt.Println("User key, ", user_key)
}
CREATE TABLE `users` (
`user_id` INT(10) NOT NULL AUTO_INCREMENT,
`user_key` INT(11) NULL DEFAULT '0',
`user_login` VARCHAR(35) NULL DEFAULT '0',
PRIMARY KEY (`user_id`)
)
2016/06/10 10:17:54 sql: expected 3 destination arguments in Scan, not 1
Answer the question
In order to leave comments, you need to log in
Because the syntax is wrong, as you were told.
If you remove all your code, you get complete crap:
$(".svg").each(
function(){
(
function () { /* Тут ваш код, который, кажется, должен работать нормально */ };
window.deSVG = desvg;
}
)();
deSVG(".svg", true);
}
);
Your problem is easily solved by reading the documentation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question