SQL or the Code?

07/17/2016 09:11 pakinglalat#1
Hi epvp, I have a problem where when I buy an item in my webshop it won't execute. I receive an error that says "The script could not be executed:
This item could not be sent.". This just happens last week, and I have no idea why it just happens as to I am not touching anything in the code. Can someone help me?
07/17/2016 11:25 Drabur#2
you use the webshop from sedrika?
07/18/2016 03:16 pakinglalat#3
Quote:
Originally Posted by Drabur View Post
you use the webshop from sedrika?
Hello there, I am not using Sedrikas. Just the sapphires default. What could be the fault?
07/18/2016 09:06 xTwiLightx#4
Check ODBC Errors in your PHP Error file (in Windows C:\Windows\Temp\php_errors.log by default).

But thats only the case when the ODBC function calls used by the item sender are not error-supressed ( e.g. @[Only registered and activated users can see links. Click Here To Register...]c_exec).
07/18/2016 15:08 pakinglalat#5
Quote:
Originally Posted by xTwiLightx View Post
Check ODBC Errors in your PHP Error file (in Windows C:\Windows\Temp\php_errors.log by default).

But thats only the case when the ODBC function calls used by the item sender are not error-supressed ( e.g. @[Only registered and activated users can see links. Click Here To Register...]c_exec).
Hi there, thank you for giving me hope by replying but "php_errors.log" is not present in the said folder. I cannot seem to find it in the "C:" drive whenever I try to search for it. I believe that I do not have any faults in the code because I did not touch anything in it.
07/18/2016 16:50 xTwiLightx#6
Quote:
Originally Posted by pakinglalat View Post
Hi there, thank you for giving me hope by replying but "php_errors.log" is not present in the said folder. I cannot seem to find it in the "C:" drive whenever I try to search for it. I believe that I do not have any faults in the code because I did not touch anything in it.
Sorry, it could be C:\Temp, not C:\Windows\Temp.

It really depends how PHP is configured on your system, but mostly it was C:\Temp.
07/19/2016 05:27 pakinglalat#7
Quote:
Originally Posted by xTwiLightx View Post
Sorry, it could be C:\Temp, not C:\Windows\Temp.

It really depends how PHP is configured on your system, but mostly it was C:\Temp.

Hello there again, it is not present too. This problem is really bad, I really need to fix this issue because coins/votepoints will be deducted whenever someone buy anything in the shop. Also whenever I add any news from the administration panel, it won't be present in the database though it says that it successfully been added.
07/19/2016 14:15 xTwiLightx#8
How did you setup your website?
IIS with PHP or XAMPP?

We need way more details than you gave us.


Maybe you should look for this one in your sites/shop.php:
Code:
if(isset($_POST['shopBuyItem'])) {
And remove all leading @'s before your odbc_exec function calls.


Quote:
@odbc_exec
to
Quote:
odbc_exec

This should make it possible for your site to log errors.
But we really need to know where your error logs are.
07/22/2016 08:42 pakinglalat#9
Quote:
Originally Posted by xTwiLightx View Post
How did you setup your website?
IIS with PHP or XAMPP?

We need way more details than you gave us.


Maybe you should look for this one in your sites/shop.php:
Code:
if(isset($_POST['shopBuyItem'])) {
And remove all leading @'s before your odbc_exec function calls.



to



This should make it possible for your site to log errors.
But we really need to know where your error logs are.
Hello there, sorry for the very late reply. I will be trying to do this for the php log to show up. Since I only have the errors for the apache I believe but in the apache error logs there are some php related errors and I do not see any thing regarding the cause of my problem in it. I am using XAMPP.

This is the one you are talking about that I did not alter in any way:

Code:
	if(isset($_POST['shopBuyItem'])) {
					if( [MENTION=311501]ODB[/MENTION]c_exec($odbc_connect, $strUpdateBalance)
						AND
						 [MENTION=311501]ODB[/MENTION]c_exec($odbc_connect, '
                                INSERT INTO [' . $_CONFIG['db_databases']['web'] . '].dbo.[LOG_PURCHASES] (
                                    item,
                                    itemname,
                                    itemcount,
                                    itemcurrency,
                                    itemworth,
                                    account,
                                    datetime
                                ) VALUES (
                                    ' . cleanSqlInput($mixedSelectedItemDetailsArray['itemid']) . ',
                                    \'' . cleanSqlInput($mixedSelectedItemDetailsArray['name']) . '\',
                                    ' . cleanSqlInput($mixedSelectedItemDetailsArray['count']) . ',
                                    ' . $intGetCurrentCurrency . ',
                                    ' . cleanSqlInput($mixedSelectedItemDetailsArray[$intWorthColumnHelper]) . ',
                                    \'' . cleanSqlInput($_SESSION['user']) . '\',
                                    \''. date($_CONFIG['web_date_format']['dbDatetime']) .'\'
                                )
							')
						AND
							send_item($intCharacterID, $mixedSelectedItemDetailsArray['itemid'], $mixedSelectedItemDetailsArray['count'])
					) {
						echo createMessage($_LANG['success_item_bought'], 'success');
					}
					else {
						echo createMessage($_LANG['error_item_could_not_be_sent'], 'fail');
					}
				}
07/22/2016 20:13 xTwiLightx#10
Quote:
Originally Posted by pakinglalat View Post
Hello there, sorry for the very late reply. I will be trying to do this for the php log to show up. Since I only have the errors for the apache I believe but in the apache error logs there are some php related errors and I do not see any thing regarding the cause of my problem in it. I am using XAMPP.

This is the one you are talking about that I did not alter in any way:

Code:
    if(isset($_POST['shopBuyItem'])) {
                    if( [MENTION=311501]ODB[/MENTION]c_exec($odbc_connect, $strUpdateBalance)
                        AND
                         [MENTION=311501]ODB[/MENTION]c_exec($odbc_connect, '
                                INSERT INTO [' . $_CONFIG['db_databases']['web'] . '].dbo.[LOG_PURCHASES] (
                                    item,
                                    itemname,
                                    itemcount,
                                    itemcurrency,
                                    itemworth,
                                    account,
                                    datetime
                                ) VALUES (
                                    ' . cleanSqlInput($mixedSelectedItemDetailsArray['itemid']) . ',
                                    \'' . cleanSqlInput($mixedSelectedItemDetailsArray['name']) . '\',
                                    ' . cleanSqlInput($mixedSelectedItemDetailsArray['count']) . ',
                                    ' . $intGetCurrentCurrency . ',
                                    ' . cleanSqlInput($mixedSelectedItemDetailsArray[$intWorthColumnHelper]) . ',
                                    \'' . cleanSqlInput($_SESSION['user']) . '\',
                                    \''. date($_CONFIG['web_date_format']['dbDatetime']) .'\'
                                )
                            ')
                        AND
                            send_item($intCharacterID, $mixedSelectedItemDetailsArray['itemid'], $mixedSelectedItemDetailsArray['count'])
                    ) {
                        echo createMessage($_LANG['success_item_bought'], 'success');
                    }
                    else {
                        echo createMessage($_LANG['error_item_could_not_be_sent'], 'fail');
                    }
                }
That is the right place, remove the '@' symbol at every odbc_exec.This should show errors regarding this scope.
08/01/2016 15:21 pakinglalat#11
The problem is now fixed and was due to our memory compressing technology that we used. Restart was just the fix