arcticbb

It is currently Thu May 31, 2007 10:02 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: T-Xore delete.php - Help me phrostwave
PostPosted: Sun May 20, 2007 8:56 pm 
Offline
User

Joined: Sun May 20, 2007 8:50 pm
Posts: 5
When deleting a torrent from registered users, the script doesn't update the database on 'uploads' and 'comments' table for each user. If a user have 10 torrents uploaded, when I run the script, the 'uploads' table is updated to 0 and 'comments' stay the same.
Anybody knows how to do this works fine? Here the code that I'm using.
here you find my script = http://teste.dannlopes.cjb.net/

Quote:
$result = mysql_query("SELECT * FROM torrents LEFT JOIN users ON torrents.posted_by = users.username WHERE id = '$id' LIMIT 1") or die (mysql_error());
if (!$posted_by == 0){ // if user is registered, because guest users are set to 0
while ($row = mysql_fetch_array($result)){
extract($row);
mysql_query("UPDATE categories SET torrents = 'torrents-1' WHERE subid = '$subcat' LIMIT 1") or die (mysql_error());
mysql_query("DELETE FROM comments WHERE id = '$id' LIMIT 1") or die (mysql_error());
mysql_query("DELETE FROM description WHERE id = '$id' LIMIT 1") or die (mysql_error());
mysql_query("DELETE FROM torrents WHERE id = '$id' LIMIT 1") or die (mysql_error());
//the line below I'm trying to use but didn't work, a try to use this line after 'while' but didn't work again
mysql_query("UPDATE users SET uploads = 'uploads-1' WHERE username = '$posted_by' LIMIT 1") or die (mysql_error());
@unlink('.'.$btdir.'/'.$hash.'.bogtor');
}
}
else{ // if guest user
while ($row = mysql_fetch_array($result)){
extract($row);
mysql_query("UPDATE categories SET torrents = 'torrents-1' WHERE subid = '$subcat' LIMIT 1") or die (mysql_error());
mysql_query("DELETE FROM comments WHERE id = '$id' LIMIT 1") or die (mysql_error());
mysql_query("DELETE FROM description WHERE id = '$id' LIMIT 1") or die (mysql_error());
mysql_query("DELETE FROM torrents WHERE id = '$id' LIMIT 1") or die (mysql_error());
@unlink('.'.$btdir.'/'.$hash.'.bogtor');
}
}


Report this post
 
 Profile Email  
Reply with quote  
 Post subject: Re: T-Xore delete.php - Help me phrostwave
PostPosted: Mon May 21, 2007 7:29 am 
Offline
x_x

Joined: Tue Apr 24, 2007 2:47 pm
Posts: 39
im not sure why it would be doing that guibean, everything seems to be in place through the script - i will look into this more when i get off work today Smile

i did try to run your script and got an oldschool 127 error from the table handler - looks like i need to do some table repairs Confused

_________________
AKNOVA.INFO


Venetian Snares - Hajnal / Szerencsétlen


Report this post
 
 Profile  
Reply with quote  
 Post subject: Re: T-Xore delete.php - Help me phrostwave
PostPosted: Mon May 21, 2007 10:09 am 
Offline
User

Joined: Sun May 20, 2007 8:50 pm
Posts: 5
error, where?
in which archive .php?


I forgive for the English I am that use a translator

Thanks


Report this post
 
 Profile Email  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
arcticSilver1 template by phrostwave

powered by phpBB © 2002, 2006 phpBB Group
[ Time : 0.107s | 9 Queries | GZIP : On ]