Author Topic: Error with sending item  (Read 2534 times)

Offline Eastwood

Error with sending item
« on: November 22, 2006, 04:44:30 am »
Hi everybody!  :)

First of all, sorry for my english I know it´s not very good.  :-[  Well, I´ve got an error when I send an item to anybody. I´ll try to explain better: When I go to the "send item", if I push the bottom to send without a name of user in the box I have this error:

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 'WHERE id = 1' at line 3
File: path_to_server/Sources/shop/Shop-Send.php
Line: 183

I´ve seen the line 183 of Shop-send.php and it is:

WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);

What can I do? I have a lot of errors, it shouldn´t show something like: "Put the correct user in the box" or something like that? I don´t want the error shows my server direction too...  :(  Is there something I can add to that 183 line to resolve the error?

Thanks to everybody and sorry again for my english

Eastwood

Offline Daniel15

Re: Error with sending item
« Reply #1 on: November 22, 2006, 04:35:21 pm »
OK, I fixed this. Please try this patch:
Open Shop-Send.php, and find:
Code: [Select]
// You don't add the item? Sorry, but we don't allow stealing! :D
if ($rowItem['ownerid'] !== $ID_MEMBER) die($txt['shop_use_others_item']);
   
// Get new owner's information
$result = db_query("SELECT ID_MEMBER
FROM {$db_prefix}members
WHERE memberName = '{$_POST['membername']}'", __FILE__, __LINE__);
$rowNewOwner = mysql_fetch_array($result, MYSQL_ASSOC);

Add after:
Code: [Select]

// If the user doesn't exist, it's bad!
if (mysql_num_rows($result) == 0 || !isset($rowNewOwner['ID_MEMBER']) || $rowNewOwner['ID_MEMBER'] == 0) {
printf($txt['shop_member_no_exist'], htmlentities($_POST['membername']));
die();
}

Offline Eastwood

Re: Error with sending item
« Reply #2 on: November 24, 2006, 02:47:03 am »
Yes! It works perfectly!  O0

Thanks for all, Daniel15!!  :)


Eastwood