Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

Development::Feature Requests Post suggestions/feature requests here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 08-25-2005, 12:20 AM
Magoth78
Discordant
 
Join Date: Jun 2003
Posts: 345
Default

Just a little fix on my code.

Instead of checking the AccountName for the Character, it will check the AccountID .
As noticed, in the Account table, you only have 1 character per account created, this is the first character. And you don't have the others created chars in the account table, it's why I fixed that by checking the character AccountID.

Code:
<?php

$host = 'your_host';
$dbuser = 'user';
$dbpass = 'password';
$db = 'dbname';

$link = mysql_connect($host, $dbuser, $dbpass)
   OR die(mysql_error());

if (!mysql_select_db($db, $link))
	{
    	echo 'Unable to connect to the database.';
	echo mysql_errno($link) . ": " . mysql_error($link). "\n";
    	exit;
	}

// Query
$charname = $_POST['charname'];
$accountname = $_POST['accountname'];


$query = mysql_query("SELECT zonename FROM empire.character_ WHERE name='$charname';");
	if (!$query) {
   	die('Could not query:' . mysql_error());
	}
	$find_zonename = mysql_result($query, 0);
	echo "Found zone is..... :<b> $find_zonename </b> \r\n <br>";

$query2 = mysql_query("SELECT zoneid FROM character_ WHERE zonename='$find_zonename' LIMIT 1;");
	if (!$query2) {
   	die('Could not query:' . mysql_error());
	}
	$find_zoneid = mysql_result($query2, 0);
	

$query3 = mysql_query("SELECT account_id FROM character_ WHERE name='$charname';");
	if (!$query3) {
   	die('Could not query:' . mysql_error());
	}
	$find_accountid = mysql_result($query3, 0);
	

$query3a = mysql_query("SELECT id FROM account WHERE name='$accountname';");
	if (!$query3a) {
   	die('Could not query:' . mysql_error());
	}
	$verifyaccount_id = mysql_result($query3a, 0);
	

$query4 = mysql_query("SELECT safe_x FROM zone WHERE zoneidnumber='$find_zoneid';");
	if (!$query4) {
   	die('Could not query:' . mysql_error());
	}
	$find_safex = mysql_result($query4, 0);
	

$query5 = mysql_query("SELECT safe_y FROM zone WHERE zoneidnumber='$find_zoneid';");
	if (!$query5) {
   	die('Could not query:' . mysql_error());
	}
	$find_safey = mysql_result($query5, 0);
	

$query6 = mysql_query("SELECT safe_z FROM zone WHERE zoneidnumber='$find_zoneid';");
	if (!$query6) {
   	die('Could not query:' . mysql_error());
	}
	$find_safez = mysql_result($query6, 0);
	//echo $find_accountname;

		if($find_accountid != $verifyaccount_id)
		{
		echo ("Account name matched with this char ...  <b> Failed! </b> \r\n <br> <b> Verify your Character's name and your's Account's name!"); 
		mysql_close($link);
		exit;
		}
		

		if($find_accountid = $verifyaccount_id)
		{
			echo ("Account name matched with this char ...  <b> Ok! </b> \r\n <br>");
			$charmove = mysql_query("UPDATE character_ SET zonename='$find_zonename', zoneid='$find_zoneid', x='$find_safex', y='$find_safey', z='$find_safez'  WHERE name='$charname';");
			if (!$charmove) {
   			die('Could not query:' . mysql_error());
			}
			echo ("Character moved to his actual zone safe point. \r\n");
			mysql_close($link);
		}

?>
Enjoy,

Mag
__________________
User's projects:
-- Original EMPIRE I/II and Factions! servers
-- Web GM Portal
-- EQoffline/bots
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:23 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3