downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

mysql_client_encoding> <mysql_affected_rows
Last updated: Fri, 13 Nov 2009

view this page in

mysql_change_user

(PHP 3 <= 3.0.13)

mysql_change_userアクティブな接続でログイン中のユーザーを変更する

説明

int mysql_change_user ( string $user , string $password [, string $database [, resource $link_identifier ]] )

mysql_change_user() は、現在アクティブな接続 またはオプションのパラメータ link_identifier が指定された場合にはその接続にログイン中のユーザーを変更します。 database が指定された場合、ユーザーが変更された後 このデータベースがカレントのデータベースとなります。 新規の user/password の組み合わせの認証に失敗した場合、 現在接続中のユーザーがアクティブなままとなります。

この関数は廃止されており、もはや PHP には存在しません。

パラメータ

user

新しい MySQL ユーザー名です。

password

新しい MySQL パスワードです。

database

MySQL データベース名です。指定しなかった場合は、 現在選択されているデータベースが利用されます。

link_identifier

MySQL 接続。 指定されない場合、mysql_connect() により直近にオープンされたリンクが 指定されたと仮定されます。そのようなリンクがない場合、引数を指定せずに mysql_connect() がコールした時と同様にリンクを確立します。 リンクが見付からない、または、確立できない場合、 E_WARNING レベルのエラーが生成されます。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

注意

注意: 条件
この関数は MySQL 3.23.3 以降が必要です。

参考



add a note add a note User Contributed Notes
mysql_change_user
what at the dot hell
11-Sep-2008 12:48
Why did they remove this function? This is useful! I'm all over the place with databases and users. Some users can only insert, others only delete - this would be the easiest way and -- they removed it. I'm calling shenanigans on PHP!

mysql_client_encoding> <mysql_affected_rows
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites