Page 7 of 14

Posted: Fri Sep 01, 2006 4:53 pm
by msknight
:oops:

Posted: Fri Sep 01, 2006 8:34 pm
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

Posted: Fri Sep 01, 2006 10:20 pm
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.

Posted: Mon Sep 04, 2006 9:11 am
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

Posted: Mon Sep 04, 2006 12:03 pm
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.

Posted: Mon Sep 04, 2006 12:29 pm
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.

Posted: Mon Sep 04, 2006 4:11 pm
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?

Posted: Mon Sep 04, 2006 7:07 pm
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.

Posted: Mon Sep 04, 2006 11:23 pm
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?

Posted: Tue Sep 05, 2006 7:30 am
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);

Posted: Tue Sep 05, 2006 10:23 am
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.

Posted: Tue Sep 05, 2006 11:04 am
by law
hm i dont know if this nesting stuff afflects the result.
I try this this evening

Posted: Tue Sep 05, 2006 11:11 am
by Paul_Atrides
Image

php Errors from Admin part

Posted: Tue Sep 05, 2006 11:29 am
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?

Posted: Tue Sep 05, 2006 11:33 am
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.