4images Forum & Community
4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: Lucifix on June 24, 2005, 02:54:27 PM
-
Can anyone help me with this one...
when I or any other member is trying to upload image in gallery we get this error:
DB Error: Bad SQL Query: SELECT user_limit FROM 4images_users WHERE user_id =
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
DB Error: Bad SQL Query: SELECT COUNT(*) AS num_rows_all FROM 4images_images WHERE image_active = 1 AND user_id= AND image_date > 1119087504
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND image_date > 1119087504' at line 3
Image added: test Luc (1312686213.jpg)
That error doesn't effect on image upload, but it confuses all other members. :?
-
it must be something "custom" u've added...
-
I don't know why, becouse I didn't do any changes.
I have installed year ago this mod [Mod] User upload limits:
http://www.4homepages.de/forum/index.php?topic=3607.0
And this is the code from functions which is almost the same:
function check_daily_picture_limit($user_id) {
global $site_db, $site_template;
$sql = "SELECT user_limit FROM ".USERS_TABLE." WHERE user_id = $user_id";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$upload_limit = ($row['user_limit']);
$site_template->register_vars("upload_limit", $upload_limit);
$limit_cutoff = time() - 60 * 60 * 48;
$sql = "SELECT COUNT(*) AS num_rows_all
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND user_id=$user_id AND image_date > $limit_cutoff";
$row = $site_db->query_firstrow($sql);
$images_per_user = $row['num_rows_all'];
$site_template->register_vars("images_per_user", $images_per_user);
if($images_per_user >= $upload_limit) {
return false;
} else {
return true;
}
}
-
please continue discuss any issues regarding that mod under the mod's topic, your issue is obviosly result of incorrect/false code from that mod.
P.S. try to replace $user_info['user_id'] in this line:if (!check_daily_picture_limit($user_info['user_id']))) {
with $user_id (or opposite)
[topic locked]