Help needed for dropcalc testing.

If something doesn't fit in any other forum then post it here.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Locked
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

:oops:
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

Ah, man, I've nearly finished the documentation ... and I've just done the doc for the recipe calculator ...

Take a look at the recipe for Sword of Valhalla Blade, it's the long one at the bottom! ...

http://195.7.255.202/documentation/talk13.htm
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

Getting there with the recipe colours. Apparently, the main colour depends on the grade of the item that is made. White no grade, Blue D, Yellow C, Red B, Purple A, Black S, Green common. That'll be in for 3.1. Already done the third class changes in the reference.
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
law
Posts: 33
Joined: Wed Aug 02, 2006 8:21 pm

Post by law »

Hi again i found some problems in latest version:

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /var/www/web2/html/dropcalc/checkdb.php on line 136

Accounts without characters -

I found this when i clicked on Check database. Seems to be a problem wirh mysql_num_rows
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

law wrote:Hi again i found some problems in latest version:
Thanks for the heads up Law!

This is the code...
$sql = "select count(*) FROM $dblog_l2jdb.accounts WHERE login NOT IN (SELECT account_name FROM characters)";
$result = mysql_query($sql,$con);
$count = mysql_result($result,0,"count(*)");

The $count = ... line is that one. It is supposed to return a count of the number of accounts which do not have characters assigned to them.

Can't figure how that is failing, unless the "accounts" table is looking at the wrong place. Do an echo "<p>$sql</p>" just after the $result and see if it is looking at the right table in the right database.

I'll check it out when I get home tonight.
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
law
Posts: 33
Joined: Wed Aug 02, 2006 8:21 pm

Post by law »

hm seems to me that my mysql version is not able to handle such a capsuled query. i tryed it by hand but no result.
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

law wrote:hm seems to me that my mysql version is not able to handle such a capsuled query. i tryed it by hand but no result.
What version are you running? If yours is later than mine, then I will definately need to recode ... but then I may recode anyway if it is giving people problems. It will mean just shifting responsibility for the aray to the PHP rather than the mySQL engine, which will lose time as the SQL engine is way faster at this type of query.

My recoding to avoid the error is of no use if it would not do its job.

If you separate the statements, does it work on your version?
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
law
Posts: 33
Joined: Wed Aug 02, 2006 8:21 pm

Post by law »

i use MySQL 4.0.24 i played a bit around and if i do a normal query without this count thing then it works.

I just do the query and then call mysql_num_rows. does the same for me.
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

law wrote:I just do the query and then call mysql_num_rows. does the same for me.
Can you let me have the code that works for you please? I'll update the code with it.

Is everything else working for you?
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
law
Posts: 33
Joined: Wed Aug 02, 2006 8:21 pm

Post by law »

$sql = "select login FROM $dblog_l2jdb.accounts WHERE login NOT IN (SELECT account_name FROM characters)";
$result = mysql_query($sql,$con);
$count = mysql_num_rows($result);
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

law wrote:$sql = "select login FROM $dblog_l2jdb.accounts WHERE login NOT IN (SELECT account_name FROM characters)";
$result = mysql_query($sql,$con);
$count = mysql_num_rows($result);
Ah! Right! I understand now. I thought it was the nesting that was causing the trouble. I've used COUNT(*) in at least one other place, so I'll have to review that as well.

I'll get that dealt with tonight; I hope; life has thrown me a couple of curve balls this last two days.
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
law
Posts: 33
Joined: Wed Aug 02, 2006 8:21 pm

Post by law »

hm i dont know if this nesting stuff afflects the result.
I try this this evening
Paul_Atrides
Posts: 32
Joined: Wed Jun 07, 2006 2:03 pm
Contact:

Post by Paul_Atrides »

Image

php Errors from Admin part
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

Paul_Atrides wrote: php Errors from Admin part
That is in this code ...

Code: Select all

		if (($action == "extinit") && ($user_access_lvl >= $sec_inc_admin))	
		{
			$usetelnet = fsockopen($telnet_host, $telnet_port, &$errno, &$errstr, $telnet_timeout);
			if($usetelnet)
			{
				$give_string = 'extinit';
				fputs($usetelnet, $telnet_password);
				fputs($usetelnet, "\r\n");
				fputs($usetelnet, $give_string);
				fputs($usetelnet, "\r\n");
				fputs($usetelnet, "exit\r\n");
			}
			else
			{	echo "<p class="popup">Couldn't connect to telnet</p>";	}
		}
... it is the fsockopen that seems to have caused that. I'll take a look at the error message when I'm able. Looks like something has changed in the PHP version.

If that is the case, then anything using telnet will probably fail.

What version of PHP are you running please?
Last edited by msknight on Tue Sep 05, 2006 11:40 am, edited 2 times in total.
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

msknight wrote:
Paul_Atrides wrote: php Errors from Admin part
... it is the fsockopen that seems to have caused that. I'll take a look at the error message when I'm able. Looks like something has changed in the PHP version.
Yep - php.ini needs to be changed. Read http://trac.wordpress.org/ticket/1583 and that should put you right. It was a change in PHP 5. I can't change the code without breaking PHP 4 versions. If anyone happens to have a better solution to this, it would be most welcome.

Basically, in your php.ini, you need to adjust ...

allow_call_time_pass_reference = True

... and possibly reboot the server or restart the php service.

Let me know if that works.

Also note ... "It should be noted that this is not just a PHP5 issue, the warning comes up in PHP4 using the recommended php.ini."

and this ... "If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer."

... so I've got to fix it at some point.

If anyone is knowledgeable enough in PHP to help me fix the above code for version 4 and 5, and future ... I'd be grateful.
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
Locked