English 中文(简体)
PHPkouite3类外衣功能不以失败告发
原标题:PHP SQLite3 class exec function not returning false on fail

I m 采用LQ3, 并用KLQ3级设备建造。 下面的法典没有按照我所熟悉的其他神秘等级来设想。 rel=“nofollow”>manual说,如果查询成功,则exec方法应当归还。 然而,从我所能看到的角度来看,这似乎没有。

$udb = new SQLite3( app.sqlite );

if($udb->exec("DELETE FROM users WHERE id = $del") != FALSE)
    $message =  Deleted User ;
 else
    $message =  Could not delete the user. ;

I would expect that if the row with that ID did not exist, the query would return false or 0 or 0 . None of these are accurate. In fact, I can t figure out what the function is returning at all.

Could someone help out with what this error checking if block should look like?

最佳回答
问题回答

Successfully executing the query is not the same as a returning FALSE on failure.

如果你无效,它就会失败(问询),并将退回虚假。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签