Guild reset in php

10/07/2012 15:52 Speederes#1
Hi.

I want guild reseting in php. Please help me.

My code:

Code:
<?php
  $con = mssql_connect('*****','***','***');
  mssql_select_db('SRO_VT_SHARD', $con);

	$sql = "DELETE FROM _TimedJob WHERE CharID = 'ID' and JobID = '1'";
    $res = mssql_query($sql,$con);
	if (!$res) {
    print("SQL statement failed with error:\n");
    print("   ".mssql_get_last_message()."\n");
  } else {
    $number_of_rows = mssql_rows_affected($con);
    print("$number_of_rows rows deleted.\n");
  }
	
?>
How can I get the Char Id in logged in player(at the website)?
10/08/2012 22:35 sarkoplata#2
$char_array = mssql_fetch_array(mssql_query("SELECT * FROM _Char WHERE CharName16='Charname'", $connection));
$char_id = $char_array['CharID'];

(dunno how mssql system work with php, made this for odbc, should be the same)
10/08/2012 23:18 Speederes#3
I have ODBC But i don't know how work with this.

I copied the code to the my code. But doesn't work. :(
10/09/2012 20:18 sarkoplata#4
Dear dude,
Do you want to delete a chars guild penalty?

So I would not give you wrong code
10/10/2012 11:37 Speederes#5
Yes i want deleting guild penelatly reseting.


Code:
<?php
  $con = mssql_connect('*****','****','****');
  mssql_select_db('SRO_VT_SHARD', $con);
    $char_array = mssql_fetch_array(mssql_query("SELECT * FROM _Char WHERE CharName16='Charname'", $con));
    $char_id = $char_array['CharID'];
	$sql = "DELETE FROM _TimedJob WHERE CharID = '$char_id' and JobID = '1'";
    $res = mssql_query($sql,$con);
	if (!$res) {
    print("SQL statement failed with error:\n");
    print("   ".mssql_get_last_message()."\n");
  } else {
    $number_of_rows = mssql_rows_affected($con);
    print("$number_of_rows rows deleted.\n");
  }
	
?>
I give 0 rows deleted. :-/
I have 1 character. But if i have 2 characters? :-/
10/10/2012 22:51 sarkoplata#6
You want to delete every characters penalty?
10/11/2012 10:47 Speederes#7
Not.

I or other player logged on the website.
Click to Guild reset and i want delete the guildpenaltly.