[RELEASE] PHP DropFinder V3

07/27/2016 18:31 Trayne01#1
Hello everyone,
I made a modernized version of [Only registered and activated users can see links. Click Here To Register...].

You will be able to list mobs who are dropping the wished item. The goal is to avoid to update your droplist webpage on your website at each time you change a single drop.
Now? All you have to do is make an iframe to this script.

So wich are the new features?
  • 100% ODBC made, no need special php drivers
  • New modern design
  • Added automatic item selection (no need to type item name)
  • Decent anti-injection security (using odbc_prepare, you can now use this script on your public website)
  • Mob ele icons, mob map
  • EP4, EP5 & EP6 map display

Here is a screenshoot:
[Only registered and activated users can see links. Click Here To Register...]

Credits:

Online Demo:
Here: [Only registered and activated users can see links. Click Here To Register...]

How to setup:

Run the DropFinder.sql file (no needed if you were using my old release)
Put the php files on your webserver, and don't forget to edit odbcConnect.php with your db id & password


Changelog:
V3.0: initial v3 release



Download:
07/27/2016 19:00 THEXxmateo#2
Great work!

i have a problem!
[Only registered and activated users can see links. Click Here To Register...]
07/27/2016 19:14 Trayne01#3
Hello THEXxmateo,
Did you edited the inc/odbcConnect.php file with your right sql server IDs ?
07/27/2016 19:17 THEXxmateo#4
Quote:
Originally Posted by Trayne01 View Post
Hello THEXxmateo,
Did you edited the inc/odbcConnect.php file with your right sql server IDs ?
Hi!
Yes:
07/27/2016 19:24 Trayne01#5
Which version of SQL Server are you using?

If you are using an old version, then please try to replace

odbcConnect.php on line 18
PHP Code:
$odb_conn odbc_connect("Driver={SQL Server Native Client 11.0};Server=$sqlHost;Database=$databaseg;"$sqlUser$sqlPass); 
to this:
PHP Code:
$odb_conn odbc_connect("Driver={SQL Server Native Client 10.0};Server=$sqlHost;Database=$databaseg;"$sqlUser$sqlPass); 
07/27/2016 19:30 THEXxmateo#6
Quote:
Originally Posted by Trayne01 View Post
Which version of SQL Server are you using?

If you are using an old version, then please try to replace

odbcConnect.php on line 18
PHP Code:
$odb_conn odbc_connect("Driver={SQL Server Native Client 11.0};Server=$sqlHost;Database=$databaseg;"$sqlUser$sqlPass); 
to this:
PHP Code:
$odb_conn odbc_connect("Driver={SQL Server Native Client 10.0};Server=$sqlHost;Database=$databaseg;"$sqlUser$sqlPass); 
Thanks, it worked me!

I get this error when testing :(

[Only registered and activated users can see links. Click Here To Register...]

I think I'll upgrade to the latest SQL Server xD
07/27/2016 21:05 Trayne01#7
Try to run this:

Code:
USE PS_GameDefs
		SELECT dbo.Mobs.MobID, dbo.Mobs.MobName, dbo.Mobs.HP, dbo.Mobs.Level, dbo.Mobs.Attrib, dbo.MobItems.DropRate, dbo.MobItems.ItemOrder, dbo.MapNames.MapName
			FROM dbo.MobItems 
			INNER JOIN Mobs ON dbo.Mobs.MobID = dbo.MobItems.MobID 
				  JOIN MapNames ON dbo.Mobs.MapID = dbo.MapNames.MapID
		WHERE Grade = (SELECT TOP 1 Grade FROM PS_GameDefs.dbo.Items WHERE ItemID = 1001) ORDER BY dbo.MobItems.DropRate DESC
In SQL, then we'll see if your SQL version is a problem, or not
07/27/2016 22:29 THEXxmateo#8
Quote:
Originally Posted by Trayne01 View Post
Try to run this:

Code:
USE PS_GameDefs
		SELECT dbo.Mobs.MobID, dbo.Mobs.MobName, dbo.Mobs.HP, dbo.Mobs.Level, dbo.Mobs.Attrib, dbo.MobItems.DropRate, dbo.MobItems.ItemOrder, dbo.MapNames.MapName
			FROM dbo.MobItems 
			INNER JOIN Mobs ON dbo.Mobs.MobID = dbo.MobItems.MobID 
				  JOIN MapNames ON dbo.Mobs.MapID = dbo.MapNames.MapID
		WHERE Grade = (SELECT TOP 1 Grade FROM PS_GameDefs.dbo.Items WHERE ItemID = 1001) ORDER BY dbo.MobItems.DropRate DESC
In SQL, then we'll see if your SQL version is a problem, or not
Result:
07/28/2016 00:23 sominus#9
Small suggestions:
  • Your select "Var1" field, fills up with almost all valid items in the DB, so you could end with hundreds of names there. May be it was better just to type the partial item name.
  • You could add ' AND Grade > 0' to avoid items that doesn't have a drop.
  • You could round the mob HP (remove the decimals) for a better look.
08/01/2016 19:53 NoMercyless#10
I was testing it in my local machine, i ran your script, tried it on browser, works fine and its a great release, but once i edited my monster.sdata and ran it on SQL it pops up some errors saying the supplied files doesnt match tables definitions and deletes all mobs on database, any tip on what to use or something would be handy.
08/01/2016 20:22 Trayne01#11
You have to drop & create the table without the MapID column, then you can run the monster.sql file that ShStudio will give you. Re-Run the dropfinder.sql to bring back map id column and their values
08/01/2016 23:19 NoMercyless#12
Quote:
Originally Posted by Trayne01 View Post
You have to drop & create the table without the MapID column, then you can run the monster.sql file that ShStudio will give you. Re-Run the dropfinder.sql to bring back map id column and their values
Would be a good idea to add it into your tread information to avoid future questions like this type ^^

Thanks for the answer.
08/01/2016 23:22 [ADM]_Dephisio#13
Or Ctrl+F and then replace ) into ,0)
09/27/2016 01:09 ASTARHOT#14
excuse me someone could help me with this?[Only registered and activated users can see links. Click Here To Register...]
I am using sql 2014 :handsdown:
09/28/2016 15:00 BodySalvage#15
line 55, change the query for SQL to this....


When using SQL in php its best to use the 3 part Database.schema.Table setup to avoid possible errors such as this.