$pdo = new PDO(...);
$stmt = $pdo -> prepare($query);
$stmt -> bindValue(1,$url);
$stmt -> execute();
Run Code Online (Sandbox Code Playgroud)
我如何检查我的查询是否成功执行?提前致谢!
可能吗?我想使用gcc像assembler之后编译它在Ubuntu上的可执行文件.
我尝试过这个:
gcc a.asm -o out.o
Run Code Online (Sandbox Code Playgroud)
并从out.o文件编译器到.out可执行文件.
但是我收到以下错误:
file format not recognized; treating as linker script.
Run Code Online (Sandbox Code Playgroud)
我是linux环境的新手.我希望这对你来说很干净.任何帮助都非常赞赏.提前致谢.
我正在用C#语言处理MySql.我正在尝试从我的数据库中获取一些数据.这些字段组织如下:
foo baa
38737 22222
Run Code Online (Sandbox Code Playgroud)
我需要获得值,foo如果我的哈希等于baa
我试过这个:我的代码(不工作)
MySqlConnection con = new MySqlConnection("Server=localhost;Database=test;Uid=user;Pwd=pass;");
con.Open();
MySqlCommand cmd = new MySqlCommand();
cmd.CommandText = string.Format("SELECT * FROM info WHERE baa = '{0}'", Hash); ;
cmd.Connection = con;
MySqlDataReader reader = cmd.ExecuteReader();
String res = reader.GetString(0);
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Invalid attempt to access a field before calling Read()
Run Code Online (Sandbox Code Playgroud)
有人可以指出我的错误吗?提前致谢.