Source of: /manual/en/function.mysql-change-user.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.mysql.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'function.mysql-change-user.php',
1 => 'mysql_change_user',
),
'up' =>
array (
0 => 'ref.mysql.php',
1 => 'MySQL Functions',
),
'prev' =>
array (
0 => 'function.mysql-affected-rows.php',
1 => 'mysql_affected_rows',
),
'next' =>
array (
0 => 'function.mysql-client-encoding.php',
1 => 'mysql_client_encoding',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="function.mysql-change-user" class="refentry">
<div class="refnamediv">
<h1 class="refname">mysql_change_user</h1>
<p class="verinfo">(PHP 3 <= 3.0.13)</p><p class="refpurpose"><span class="refname">mysql_change_user</span> — <span class="dc-title">Change logged in user of the active connection</span></p>
</div>
<a name="function.mysql-change-user.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">int</span> <span class="methodname"><b>mysql_change_user</b></span>
( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$user</tt></span>
, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$password</tt></span>
[, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$database</tt></span>
[, <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$link_identifier</tt></span>
]] )</div>
<p class="para rdfs-comment">
<b>mysql_change_user()</b> changes the logged in user
of the current active connection, or the connection given by the
optional <i><tt class="parameter">link_identifier</tt></i>
parameter. If a
database is specified, this will be the current database after
the user has been changed. If the new user and password
authorization fails, the current connected user stays active.
</p>
<p class="para">
This function is deprecated and no longer exists in PHP.
</p>
</div>
<a name="function.mysql-change-user.parameters"></a><div class="refsect1 parameters">
<h3 class="title">Parameters</h3>
<p class="para">
</p><dl>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">user</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
The new MySQL username.
</p>
</dd>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">password</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
The new MySQL password.
</p>
</dd>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">database</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
The MySQL database. If not specified, the current selected database
is used.
</p>
</dd>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">
link_identifier</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">The MySQL connection. If the
link identifier is not specified, the last link opened by
<a href="function.mysql-connect.php" class="function">mysql_connect()</a> is assumed. If no such link is found, it
will try to create one as if <a href="function.mysql-connect.php" class="function">mysql_connect()</a> was called
with no arguments. If no connection is found or established, an
<b><tt class="constant">E_WARNING</tt></b> level error is generated.</p></dd>
</dl>
<p>
</p>
</div>
<a name="function.mysql-change-user.returnvalues"></a><div class="refsect1 returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
Returns <b><tt class="constant">TRUE</tt></b> on success or <b><tt class="constant">FALSE</tt></b> on failure.
</p>
</div>
<a name="function.mysql-change-user.notes"></a><div class="refsect1 notes">
<h3 class="title">Notes</h3>
<blockquote><p><b class="note">Note</b>:
<b>Requirements</b><br />
This function requires MySQL 3.23.3 or higher.
<br />
</p></blockquote>
</div>
<a name="function.mysql-change-user.seealso"></a><div class="refsect1 seealso">
<h3 class="title">See Also</h3>
<p class="para">
</p><ul class="simplelist">
<li class="member"><a href="function.mysql-connect.php" class="function" rel="rdfs-seeAlso">mysql_connect()</a> - Open a connection to a MySQL Server</li>
<li class="member"><a href="function.mysql-select-db.php" class="function" rel="rdfs-seeAlso">mysql_select_db()</a> - Select a MySQL database</li>
<li class="member"><a href="function.mysql-query.php" class="function" rel="rdfs-seeAlso">mysql_query()</a> - Send a MySQL query</li>
</ul><p>
</p>
</div>
</div><?php manual_footer(); ?>