Register for your free account! | Forgot your password?

You last visited: Today at 20:29

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[question] WEB & Querys

Discussion on [question] WEB & Querys within the SRO Private Server forum part of the Silkroad Online category.

Reply
 
Old   #1
 
B13.'s Avatar
 
elite*gold: 0
Join Date: Jun 2012
Posts: 239
Received Thanks: 26
Question [question] WEB & Querys

hello,
is it possible to make a query works throw my website
like if i want to reset all players position to jangan but i don't wanna open my SQL. can it be done throw my website ?
if yes how ?
B13. is offline  
Old 10/04/2015, 21:13   #2


 
​Exo's Avatar
 
elite*gold: 28
Join Date: Aug 2014
Posts: 4,096
Received Thanks: 2,653
I am not so good at web stuff but as far as I remember php had a function called mysqli_query for this purpose.

Edit:: Yes here's a reference from W3Schools

PHP Code:
<?php
$con
=mysqli_connect("localhost","my_user","my_password","my_db");
// Check connection
if (mysqli_connect_errno())
  {
  echo 
"Failed to connect to MySQL: " mysqli_connect_error();
  }

// Perform queries 
mysqli_query($con,"SELECT * FROM Persons");
mysqli_query($con,"INSERT INTO Persons (FirstName,LastName,Age) 
VALUES ('Glenn','Quagmire',33)"
);

mysqli_close($con);
?>
​Exo is offline  
Old 10/04/2015, 22:18   #3
 
B13.'s Avatar
 
elite*gold: 0
Join Date: Jun 2012
Posts: 239
Received Thanks: 26
can't understand how the query works :/
what if i want the player to be able to reset his own chr position to jangan .
shouldn't be a button for him to press ?
thx for your reply Exo.
still need more explanation..
B13. is offline  
Old 10/05/2015, 01:14   #4

 
AceSpace's Avatar
 
elite*gold: 21
Join Date: Mar 2011
Posts: 1,613
Received Thanks: 1,122
Quote:
Originally Posted by B13. View Post
can't understand how the query works :/
what if i want the player to be able to reset his own chr position to jangan .
shouldn't be a button for him to press ?
thx for your reply Exo.
still need more explanation..
Uhm I would use what Exo posted, ps; i have no knowledge when it comes to PHP.

Quote:
PHP Code:
<?php
$con
=mysqli_connect("localhost","my_user","my_password","my_db");
// Check connection
if (mysqli_connect_errno())
  {
  echo 
"Failed to connect to MySQL: " mysqli_connect_error();
  }

// Perform queries 
mysqli_query($con,"UPDATE SRO_VT_SHARD.._Char SET LatestRegion = 25000, PosX = '1021.903', PosY = '-32.60888', PosZ = '489.0886', AppointedTeleport = 2094");
// To reset a single players' position, put where Charname = @charname or whatever
// However the query above will change the position of all the players to a place in jangan, (I randomly chosen one from database).

mysqli_close($con);
?>
AceSpace is offline  
Thanks
1 User
Old 10/05/2015, 01:28   #5
 
KoKsPfLaNzE's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 731
Received Thanks: 233
btw sro is mssql, so mysqli_query will not work thats for mysql=)

you have to use mssql_query, or better PDO =)
KoKsPfLaNzE is offline  
Thanks
2 Users
Old 10/05/2015, 23:26   #6
 
B13.'s Avatar
 
elite*gold: 0
Join Date: Jun 2012
Posts: 239
Received Thanks: 26
thx all,
but how to execute that query i mean if i just loaded the page it will be executed by it self or what ?
B13. is offline  
Reply


Similar Threads Similar Threads
Querys
01/05/2012 - Metin2 Private Server - 2 Replies
Hallo Leute, Wieder mal ein Problem Wollte Querys in der Mob_Proto einfügen aber dann kommt immer diese Fehler Meldung... Siehe Bild: http://img827.imageshack.us/img827/152/unbenannta zys.png
[Question]Gm Eq Querys
01/02/2012 - Metin2 Private Server - 0 Replies
-
[How To]Querys
08/23/2010 - Metin2 PServer Guides & Strategies - 12 Replies
Ihr wolltet schon oft Querys machen? Wusstet aber nie wie? Hier ein Tutorial. (Ich fand in der SuFu keines..) Was ihr benötigt Notepad++ Navicat Einen Server :facepalm: Brain.exe Brain.dll



All times are GMT +1. The time now is 20:30.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.