msql_query
(PHP 4, PHP 5)
msql_query — ارسال پرس و جوی mSQL
Description
resource msql_query
( string $query
[, resource $link_identifier
] )
msql_query() پرس و جو را به پایگاه داده فعال فعلی سرور مشخص شده توسط شناساگر پیوند ارسال میکند.
Parameters
- query
-
پرس و جوی SQL.
- link_identifier
-
The mSQL connection. If not specified, the last link opened by msql_connect() is assumed. If no such link is found, the function will try to establish a link as if msql_connect() was called, and use it.
Return Values
شناساگر مثبت پرس و چو mSQL در صورت موفقیت یا FALSE در صورت شکست باز میگرداند.
Examples
Example #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"];
}
?>
See Also
- msql_db_query() - فرستادن پرس و جوی mSQL
- msql_select_db() - انتخاب پایگاه داده mSQL
- msql_connect() - باز کردن اتصال mSQL
There are no user contributed notes for this page.
