Could Someone Help me on this script

08/11/2014 07:12 kelvz002#1
I wonder how to send items to all players using php,


This Script is successfully inserted items on some players, but to the players like newly registered or registered before insertion don't get items.

if someone could help me please.. :)
(sorry for bad english) xD
08/11/2014 13:52 asmodeus812#2
You can do that much easier with plain PHP. You can use procedures as well. But
i will give you a php example

If you want to send items to event inventory for all chars on the server.

$sql = select * from dbo.TCharacter
$stmt = sqlsrv_query( $conn, $sql);

Or only for online chars

$sql = "select * from dbo.TCharacterLogin where login = 1";
$stmt = sqlsrv_query( $conn, $sql);

then loop thru every char_id and insert it in event inventory .
You can use standart While. Fetch the rows while the statement is true
then you can execute the statement below

$sql2 =insert into RohanGame.dbo.TEventItem(type,attr,stack,rank,equi p_level,equip_strength,equip_dexterity,equip_intel ligence,char_id,date) values......

I believe you can get the point. Thats not detailed by any means. Its up to you to structure the script

And please if you decide to use php
Consider this basic security measures
1.Prepared Statements -> SQL Injection
2.Strip HTML Special Chars -> Cross Site Scripting
08/11/2014 17:29 kelvz002#3
Quote:
Originally Posted by asmodeus812 View Post
You can do that much easier with plain PHP. You can use procedures as well. But
i will give you a php example

If you want to send items to event inventory for all chars on the server.

$sql = select * from dbo.TCharacter
$stmt = sqlsrv_query( $conn, $sql);

Or only for online chars

$sql = "select * from dbo.TCharacterLogin where login = 1";
$stmt = sqlsrv_query( $conn, $sql);

then loop thru every char_id and insert it in event inventory .
You can use standart While. Fetch the rows while the statement is true
then you can execute the statement below

$sql2 =insert into RohanGame.dbo.TEventItem(type,attr,stack,rank,equi p_level,equip_strength,equip_dexterity,equip_intel ligence,char_id,date) values......

I believe you can get the point. Thats not detailed by any means. Its up to you to structure the script

And please if you decide to use php
Consider this basic security measures
1.Prepared Statements -> SQL Injection
2.Strip HTML Special Chars -> Cross Site Scripting
Thanks asmodeus :D this one would be helpful :handsdown:

Thanks asmodeus :D My php is now working perfectly :) Godspeed!