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

search for in the

msql_regcase> <msql_pconnect
Last updated: Fri, 13 Nov 2009

view this page in

msql_query

(PHP 4, PHP 5)

msql_querymSQL クエリを送信する

説明

resource msql_query ( string $query [, resource $link_identifier ] )

msql_query() は、指定されたリンク ID に 関連付けられたサーバ上の現在アクティブなデータベースに クエリを送信します。

パラメータ

query

SQL クエリ。

link_identifier

mSQL 接続。 指定されない場合、msql_connect() により直近にオープンされたリンクが 指定されたと仮定されます。そのようなリンクがない場合、この関数は、 msql_connect()をコールした時と同様にリンクを確立し、使用します。

返り値

成功した場合には正の mSQL リンク IDを、エラー時には FALSE を返します。

例1 msql_query() の例

<?php 
$link 
msql_connect("dbserver")
   or die(
"unable to connect to msql server: " msql_error());
msql_select_db("db"$link)
   or die(
"unable to select database 'db': " msql_error());

$result msql_query("SELECT * FROM table WHERE id=1"$link);
if (!
$result) {
   die(
"query failed: " msql_error());
}

while (
$row msql_fetch_array($result)) {
    echo 
$row["id"];
}
?>

参考



add a note add a note User Contributed Notes
msql_query
There are no user contributed notes for this page.

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