• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] db validation & connection

Started by dtiberio,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dtiberioTopic starter

Anytime you make an SQL query to the database, you should check to make sure the database is still connected, and then reconnect if the connection drops. It will make the sql calls more reliable.

so you need a function to determine if the database is still connected, and another to reconnect if the connection is dropped. then place it right before every SQL statement.

function remove_activity($type, $obj, $extra =''){
global $db;
$db->query("delete from ".DB_PREFIX."activity where user ='".user_id()."' and type = '".toDb($type)."' and object = '".toDb($obj)."' and extra = '".toDb($extra)."'" );
}
  •  

PHPVibe A.

As I know ezSQL does this in the class, not 100% sure, but I'm having this impression.

Similar topics (7)