Log in

View Full Version : Whats wrong with this query?


Xplorer4x4
09-13-2007, 07:38 PM
Can some one tell me whats wrong with this query?
$db_site->query("UPDATE " . TABLE_PREFIX . "setting SET value='' WHERE varname='cookiedomain'");
$db_site->query("UPDATE " . TABLE_PREFIX . "setting SET value='/' WHERE varname='cookiepath'");

Eikinskjaldi
09-13-2007, 09:17 PM
Nothing. It's perfect in every way.

Farcaster
09-13-2007, 09:18 PM
Shouldn't it be using, $db->query_write ?

Eikinskjaldi
09-13-2007, 09:23 PM
Shouldn't it be using, $db->query_write ?

Only for code style issues. ->query still works. Of course down the track vb may change its mind on that, and make query unavailable.

Paul M
09-13-2007, 10:02 PM
Shouldn't it be using, $db->query_write ?

Yes.

Query should not be used at all, either for reading or writing.

* @deprecated Deprecated as of 3.6. Use query_(read/write)

Xplorer4x4
09-14-2007, 02:14 AM
Shouldn't it be using, $db->query_write ?

$db->query_write("UPDATE " . TABLE_PREFIX . "setting SET value='' WHERE varname='cookiedomain'");
$db->query_write("UPDATE " . TABLE_PREFIX . "setting SET value='/' WHERE varname='cookiepath'");

So is this the correct way?

Chris M
09-14-2007, 02:19 AM
Yes that is correct :)

Chris