Scripting/Squirrel/Functions/mysql change user: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
No edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 19: Line 19:
     print("Successfully connected to read-only mode");</pre>
     print("Successfully connected to read-only mode");</pre>


By KAKAN
== Related Functions ==
{{Scripting/Squirrel/Functions/MySQL Functions}}
[[Category:Scripting/Squirrel/Functions/Mysql_Functions]]

Latest revision as of 18:27, 30 January 2017

Changes the current MySQL session authentication.

Syntax

mysql_change_user ( MySQLConnection handler, string new_username, string new_password )

Arguments

  • MySQLConnection handler - A valid MySQL link/handler
  • String new_username - The new username
  • String new_password - The password for the new username

Return value

true on success and/or false on failure

Example

handler <- mysql_connect("localhost","writer","password","database");
if( handler ) print("Successfully connected.");
else
    mysql_change_user(handler,"reader","password"),
    print("Successfully connected to read-only mode");

Related Functions