Fraxter
02-09-2013, 06:18 PM
Hi at all.
I've a small question. How is it possible to not show the db error and another self defined error in vbulletin?
My actual code looks like this, but it shows only the default vbulletin database error if an entry is duplicate:
$query = @$db->query_write ("INSERT INTO files
(info_hash,
name,
filename,
category,
size,
added)
VALUES
('" . $arr[1] . "',
'" . $db->escape_string ($vbulletin->GPC['name']) . "',
'" . $db->escape_string ($file_name) . "',
" . $vbulletin->GPC['category'] . ",
" . intval ($arr[4]) . ",
'".date('Y-m-d H:i:s')."')
");
if (!$query) { //this part doesn't work because vbulletin shows the database error before this code can be executed
if ($db->mysql_errno() == 1062) {
standard_error('File already uploaded!');
}
}Thanks in advance.
Frexter
I've a small question. How is it possible to not show the db error and another self defined error in vbulletin?
My actual code looks like this, but it shows only the default vbulletin database error if an entry is duplicate:
$query = @$db->query_write ("INSERT INTO files
(info_hash,
name,
filename,
category,
size,
added)
VALUES
('" . $arr[1] . "',
'" . $db->escape_string ($vbulletin->GPC['name']) . "',
'" . $db->escape_string ($file_name) . "',
" . $vbulletin->GPC['category'] . ",
" . intval ($arr[4]) . ",
'".date('Y-m-d H:i:s')."')
");
if (!$query) { //this part doesn't work because vbulletin shows the database error before this code can be executed
if ($db->mysql_errno() == 1062) {
standard_error('File already uploaded!');
}
}Thanks in advance.
Frexter