本文整理匯總了PHP中MYSQL_RESULT函數的典型用法代碼示例。如果您正苦於以下問題:PHP MYSQL_RESULT函數的具體用法?PHP MYSQL_RESULT怎麽用?PHP MYSQL_RESULT使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MYSQL_RESULT函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sendNewsletter
function sendNewsletter($from, $newsTitle, $newsBody)
{
$sql = "SELECT * FROM mailing_list WHERE active='1'";
$result = MYSQL_QUERY($sql);
$numberOfRows = MYSQL_NUMROWS($result);
$i = 0;
while ($i < $numberOfRows) {
$thisEmail = MYSQL_RESULT($result, $i, "email");
$thisUid = MYSQL_RESULT($result, $i, "uid");
$thisName = MYSQL_RESULT($result, $i, "full_name");
/* recipients */
$to = $thisEmail;
// note the comma
/* subject */
$subject = $newsTitle;
/* message */
$message = "Dear {$thisName} <br>";
$message .= $newsBody . '<br><br><a href="' . _PREF . 'modules/mailing_ilst/deleteMailing_list.php?thisEmailField=' . $thisEmail . '&thisUidField=' . $thisUid . '">
To unsubscribe please click here</a>';
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* additional headers */
$headers .= "To:" . $thisEmail . "\r\n";
$headers .= "From: " . $from;
/* and now mail it */
$s = mail($to, $subject, $message, $headers);
$i++;
}
if ($s) {
echo '<script>correctMessage("Message Sent successfuly");</script>';
} else {
echo '<script>errorMessage("Sorry message has not been sent, an error has occurred");</script>';
}
}
示例2: lookupField
function lookupField($table, $id_field, $lookup_field, $id_value)
{
$sql_lookup = "SELECT `{$lookup_field}` from `{$table}` where `{$id_field}` = '{$id_value}'";
$result_lookup = MYSQL_QUERY($sql_lookup);
$rows_lookup = MYSQL_NUM_ROWS($result_lookup);
if ($rows_lookup == null || ($rows_lookup = 0)) {
return 0;
} else {
$filds = explode(",", $lookup_field);
$ind = 0;
$value = "";
while ($ind < count($filds)) {
$value .= stripslashes(MYSQL_RESULT($result_lookup, 0, $filds[$ind]) . " ");
$ind++;
}
return trim($value);
}
}
示例3: statsMysqlQuery
function statsMysqlQuery()
{
global $query, $statsData;
global $year, $month, $day, $user;
$qMonthNameH = mysql_query("select date_format('00-{$month}-00', '%M') as monthNameH");
$statsData[monthNameH] = MYSQL_RESULT($qMonthNameH, "monthNameH");
$statsData[monthNameH] = @constant(_ . strtoupper($statsData[monthNameH]));
$qFields = $query[fields][0];
$selectTable = $query[tables][0];
print eval($query[htmlFields] . ";");
eval("\$selectStatsEval = \"{$query['sStats']}\";");
$resultStats = mysql_query("{$selectStatsEval}");
while ($statsData = mysql_fetch_array($resultStats, MYSQL_ASSOC)) {
$statsData[loadbytes] = $statsData[loadbytesuser] + $statsData[loadbyteshost];
$statsData[cachebytes] = $statsData[cachebytesuser] + $statsData[cachebyteshost];
$statsData[totalbytes] = $statsData[loadbytes] + $statsData[cachebytes];
if ($statsData[loadbytes] != "0") {
$statsData[loadbytes_rate] = number_format($statsData[loadbytes] / $statsData[totalbytes] * 100, 2) . "%";
$statsData[cachebytes_rate] = number_format($statsData[cachebytes] / $statsData[totalbytes] * 100, 2) . "%";
}
print eval($query[htmlRow] . ";");
}
print htmlTableEnd();
}
示例4: MYSQL_QUERY
$sql = "SELECT * FROM CHARACTER_SETS WHERE CHARACTER_SET_NAME = '{$thisCHARACTER_SET_NAME}'";
$result = MYSQL_QUERY($sql);
$numberOfRows = MYSQL_NUMROWS($result);
if ($numberOfRows == 0) {
?>
Sorry. No records found !!
<?php
} else {
if ($numberOfRows > 0) {
$i = 0;
$thisCHARACTER_SET_NAME = MYSQL_RESULT($result, $i, "CHARACTER_SET_NAME");
$thisDEFAULT_COLLATE_NAME = MYSQL_RESULT($result, $i, "DEFAULT_COLLATE_NAME");
$thisDESCRIPTION = MYSQL_RESULT($result, $i, "DESCRIPTION");
$thisMAXLEN = MYSQL_RESULT($result, $i, "MAXLEN");
}
}
?>
View Record<br><br>
<table>
<tr height="30">
<td align="right"><b>CHARACTER_SET_NAME : </b></td>
<td><?php
echo $thisCHARACTER_SET_NAME;
?>
</td>
</tr>
<tr height="30">
示例5: MYSQL_QUERY
$result = MYSQL_QUERY($sql);
$numberOfRows = MYSQL_NUMROWS($result);
if ($numberOfRows == 0) {
?>
Sorry. No records found !!
<?php
} else {
if ($numberOfRows > 0) {
$i = 0;
$thisPROPERTY_ID = MYSQL_RESULT($result, $i, "PROPERTY_ID");
$thisPROPERTYDEF_ID = MYSQL_RESULT($result, $i, "PROPERTYDEF_ID");
$thisPROPERTY_MAPPING_ID = MYSQL_RESULT($result, $i, "PROPERTY_MAPPING_ID");
$thisPROPERTY_MAPPING_TYPE = MYSQL_RESULT($result, $i, "PROPERTY_MAPPING_TYPE");
$thisPROPERTY_VALUE = MYSQL_RESULT($result, $i, "PROPERTY_VALUE");
}
}
?>
View Record<br><br>
<table>
<tr height="30">
<td align="right"><b>PROPERTY_ID : </b></td>
<td><?php
echo $thisPROPERTY_ID;
?>
</td>
</tr>
<tr height="30">
示例6: MYSQL_RESULT
$thisEVENT_OBJECT_TABLE = MYSQL_RESULT($result, $i, "EVENT_OBJECT_TABLE");
$thisACTION_ORDER = MYSQL_RESULT($result, $i, "ACTION_ORDER");
$thisACTION_CONDITION = MYSQL_RESULT($result, $i, "ACTION_CONDITION");
$thisACTION_STATEMENT = MYSQL_RESULT($result, $i, "ACTION_STATEMENT");
$thisACTION_ORIENTATION = MYSQL_RESULT($result, $i, "ACTION_ORIENTATION");
$thisACTION_TIMING = MYSQL_RESULT($result, $i, "ACTION_TIMING");
$thisACTION_REFERENCE_OLD_TABLE = MYSQL_RESULT($result, $i, "ACTION_REFERENCE_OLD_TABLE");
$thisACTION_REFERENCE_NEW_TABLE = MYSQL_RESULT($result, $i, "ACTION_REFERENCE_NEW_TABLE");
$thisACTION_REFERENCE_OLD_ROW = MYSQL_RESULT($result, $i, "ACTION_REFERENCE_OLD_ROW");
$thisACTION_REFERENCE_NEW_ROW = MYSQL_RESULT($result, $i, "ACTION_REFERENCE_NEW_ROW");
$thisCREATED = MYSQL_RESULT($result, $i, "CREATED");
$thisSQL_MODE = MYSQL_RESULT($result, $i, "SQL_MODE");
$thisDEFINER = MYSQL_RESULT($result, $i, "DEFINER");
$thisCHARACTER_SET_CLIENT = MYSQL_RESULT($result, $i, "CHARACTER_SET_CLIENT");
$thisCOLLATION_CONNECTION = MYSQL_RESULT($result, $i, "COLLATION_CONNECTION");
$thisDATABASE_COLLATION = MYSQL_RESULT($result, $i, "DATABASE_COLLATION");
?>
<TR BGCOLOR="<?php
echo $bgColor;
?>
">
<TD><?php
echo $thisTRIGGER_CATALOG;
?>
</TD>
<TD><?php
echo $thisTRIGGER_SCHEMA;
?>
</TD>
<TD><?php
echo $thisTRIGGER_NAME;
示例7: updateAfterDelete
function updateAfterDelete($table, $newId)
{
$test = 1;
echo $newId;
$s = "select * from {$table} ";
$r = mysql_query($s);
$numberOfRows = MYSQL_NUMROWS($r);
$iz = 0;
$newId = explode(',', $newId);
while ($iz < $numberOfRows) {
$id = MYSQL_RESULT($r, $iz, "id");
$arr = MYSQL_RESULT($r, $iz, "collage_id");
$selected_ids = explode(',', $arr);
$n = "";
foreach ($selected_ids as $c) {
if (!in_array($c, $newId) || $c === '0') {
$n .= $c . ",";
} else {
$test = 0;
}
}
if ($test == 0) {
$n = str_replace(',,', ',', $n);
$wq = 'UPDATE ' . $table . ' SET `collage_id`="' . $n . '" WHERE id=' . $id;
mysql_query($wq);
}
$n = "";
$test = 1;
$iz++;
}
}
示例8: while
</FORM>
<?php
}
while ($i < $numberOfRows) {
if ($i % 2 == 0) {
$bgColor = "#FFFFFF";
} else {
$bgColor = "#C0C0C0";
}
$thisCOLLATION_NAME = MYSQL_RESULT($result, $i, "COLLATION_NAME");
$thisCHARACTER_SET_NAME = MYSQL_RESULT($result, $i, "CHARACTER_SET_NAME");
$thisID = MYSQL_RESULT($result, $i, "ID");
$thisIS_DEFAULT = MYSQL_RESULT($result, $i, "IS_DEFAULT");
$thisIS_COMPILED = MYSQL_RESULT($result, $i, "IS_COMPILED");
$thisSORTLEN = MYSQL_RESULT($result, $i, "SORTLEN");
if ($thisCOLLATION_NAMEFromForm == $thisCOLLATION_NAME) {
?>
<FORM NAME="editForm" METHOD="POST" ACTION="<?php
echo $_SERVER['PHP_SELF'];
?>
">
<input type="hidden" name="action" value="Update">
<input type="hidden" name="thisCOLLATION_NAMEField" value="<?php
echo $thisCOLLATION_NAME;
?>
">
<TR BGCOLOR="<?php
echo $bgColor;
?>
">
示例9: die
die("Query to show fields from table failed");
}
$rows = MYSQL_NUMROWS($result);
if ($rows == 0) {
echo '<div style=" color:red; text-align:center;"><h5>No Comments Found!</h5></div>';
} else {
if ($rows > 0) {
$i = 0;
while ($i < $rows) {
if ($i % 2 == 0) {
$bgcolor = '#FFFFFF';
} else {
$bgcolor = '@C0C0C0';
}
$comment = MYSQL_RESULT($result, $i, "comment");
$comment_id = MYSQL_RESULT($result, $i, "comment_id");
?>
<tr>
<td><?php
echo $comment;
?>
</td>
<td align="center">
<form action="posted.php" method="post">
<input type="hidden" name="comment_id" value="<?php
echo $comment_id;
?>
" />
<input type="submit" name="post" value="Post" />
</form>
示例10: MYSQL_RESULT
<?php
} else {
if ($numberOfRows > 0) {
$i = 0;
$thisCustomer_id = MYSQL_RESULT($result, $i, "customer_id");
$thisFname = MYSQL_RESULT($result, $i, "fname");
$thisLname = MYSQL_RESULT($result, $i, "lname");
$thisCompany = MYSQL_RESULT($result, $i, "company");
$thisAddress1 = MYSQL_RESULT($result, $i, "address1");
$thisAddress2 = MYSQL_RESULT($result, $i, "address2");
$thisCity = MYSQL_RESULT($result, $i, "city");
$thisState_province = MYSQL_RESULT($result, $i, "state_province");
$thisCountry = MYSQL_RESULT($result, $i, "country");
$thisPostal_code = MYSQL_RESULT($result, $i, "postal_code");
$thisPhone = MYSQL_RESULT($result, $i, "phone");
$thisFax = MYSQL_RESULT($result, $i, "fax");
}
}
?>
<h2>更新記錄</h2>
<form name="customersUpdateForm" method="POST" action="update.php">
<table cellspacing="2" cellpadding="2" border="0" width="100%">
<tr valign="top" height="20">
<td align="right"> <b> ID : </b> </td>
<td> <input type="text" name="thisCustomer_idField" size="20" value="<?php
echo $thisCustomer_id;
?>
"> </td>
</tr>
示例11: MYSQL_RESULT
$thisSTATE = MYSQL_RESULT($result, $i, "STATE");
$thisDURATION = MYSQL_RESULT($result, $i, "DURATION");
$thisCPU_USER = MYSQL_RESULT($result, $i, "CPU_USER");
$thisCPU_SYSTEM = MYSQL_RESULT($result, $i, "CPU_SYSTEM");
$thisCONTEXT_VOLUNTARY = MYSQL_RESULT($result, $i, "CONTEXT_VOLUNTARY");
$thisCONTEXT_INVOLUNTARY = MYSQL_RESULT($result, $i, "CONTEXT_INVOLUNTARY");
$thisBLOCK_OPS_IN = MYSQL_RESULT($result, $i, "BLOCK_OPS_IN");
$thisBLOCK_OPS_OUT = MYSQL_RESULT($result, $i, "BLOCK_OPS_OUT");
$thisMESSAGES_SENT = MYSQL_RESULT($result, $i, "MESSAGES_SENT");
$thisMESSAGES_RECEIVED = MYSQL_RESULT($result, $i, "MESSAGES_RECEIVED");
$thisPAGE_FAULTS_MAJOR = MYSQL_RESULT($result, $i, "PAGE_FAULTS_MAJOR");
$thisPAGE_FAULTS_MINOR = MYSQL_RESULT($result, $i, "PAGE_FAULTS_MINOR");
$thisSWAPS = MYSQL_RESULT($result, $i, "SWAPS");
$thisSOURCE_FUNCTION = MYSQL_RESULT($result, $i, "SOURCE_FUNCTION");
$thisSOURCE_FILE = MYSQL_RESULT($result, $i, "SOURCE_FILE");
$thisSOURCE_LINE = MYSQL_RESULT($result, $i, "SOURCE_LINE");
}
}
?>
<h2>Confirm Record Deletion</h2><br><br>
<table>
<tr height="30">
<td align="right"><b>QUERY_ID : </b></td>
<td><?php
echo $thisQUERY_ID;
?>
</td>
</tr>
<tr height="30">
示例12: MYSQL_QUERY
$sql = "SELECT * FROM CMS_USERDATA WHERE USER_ID = '{$thisUSER_ID}'";
$result = MYSQL_QUERY($sql);
$numberOfRows = MYSQL_NUMROWS($result);
if ($numberOfRows == 0) {
?>
Sorry. No records found !!
<?php
} else {
if ($numberOfRows > 0) {
$i = 0;
$thisUSER_ID = MYSQL_RESULT($result, $i, "USER_ID");
$thisDATA_KEY = MYSQL_RESULT($result, $i, "DATA_KEY");
$thisDATA_VALUE = MYSQL_RESULT($result, $i, "DATA_VALUE");
$thisDATA_TYPE = MYSQL_RESULT($result, $i, "DATA_TYPE");
}
}
?>
View Record<br><br>
<table>
<tr height="30">
<td align="right"><b>USER_ID : </b></td>
<td><?php
echo $thisUSER_ID;
?>
</td>
</tr>
<tr height="30">
示例13: MYSQL_RESULT
$bgColor = "#FFFFFF";
} else {
$bgColor = "#C0C0C0";
}
$thisHISTORY_ID = MYSQL_RESULT($result, $i, "HISTORY_ID");
$thisPROJECT_ID = MYSQL_RESULT($result, $i, "PROJECT_ID");
$thisPROJECT_NAME = MYSQL_RESULT($result, $i, "PROJECT_NAME");
$thisUSER_ID = MYSQL_RESULT($result, $i, "USER_ID");
$thisPUBLISH_LOCALE = MYSQL_RESULT($result, $i, "PUBLISH_LOCALE");
$thisPUBLISH_FLAGS = MYSQL_RESULT($result, $i, "PUBLISH_FLAGS");
$thisPUBLISH_LIST = MYSQL_RESULT($result, $i, "PUBLISH_LIST");
$thisPUBLISH_REPORT = MYSQL_RESULT($result, $i, "PUBLISH_REPORT");
$thisRESOURCE_COUNT = MYSQL_RESULT($result, $i, "RESOURCE_COUNT");
$thisENQUEUE_TIME = MYSQL_RESULT($result, $i, "ENQUEUE_TIME");
$thisSTART_TIME = MYSQL_RESULT($result, $i, "START_TIME");
$thisFINISH_TIME = MYSQL_RESULT($result, $i, "FINISH_TIME");
$thisHISTORY_ID = highlightSearchTerms($thisHISTORY_ID, $thisKeyword, $highlightColor);
$thisPROJECT_ID = highlightSearchTerms($thisPROJECT_ID, $thisKeyword, $highlightColor);
$thisPROJECT_NAME = highlightSearchTerms($thisPROJECT_NAME, $thisKeyword, $highlightColor);
$thisUSER_ID = highlightSearchTerms($thisUSER_ID, $thisKeyword, $highlightColor);
$thisPUBLISH_LOCALE = highlightSearchTerms($thisPUBLISH_LOCALE, $thisKeyword, $highlightColor);
$thisPUBLISH_FLAGS = highlightSearchTerms($thisPUBLISH_FLAGS, $thisKeyword, $highlightColor);
$thisPUBLISH_LIST = highlightSearchTerms($thisPUBLISH_LIST, $thisKeyword, $highlightColor);
$thisPUBLISH_REPORT = highlightSearchTerms($thisPUBLISH_REPORT, $thisKeyword, $highlightColor);
$thisRESOURCE_COUNT = highlightSearchTerms($thisRESOURCE_COUNT, $thisKeyword, $highlightColor);
$thisENQUEUE_TIME = highlightSearchTerms($thisENQUEUE_TIME, $thisKeyword, $highlightColor);
$thisSTART_TIME = highlightSearchTerms($thisSTART_TIME, $thisKeyword, $highlightColor);
$thisFINISH_TIME = highlightSearchTerms($thisFINISH_TIME, $thisKeyword, $highlightColor);
?>
<TR BGCOLOR="<?php
echo $bgColor;
示例14: MYSQL_RESULT
} else {
if ($numberOfRows > 0) {
$i = 0;
$thisRESOURCE_ID = MYSQL_RESULT($result, $i, "RESOURCE_ID");
$thisRESOURCE_TYPE = MYSQL_RESULT($result, $i, "RESOURCE_TYPE");
$thisRESOURCE_FLAGS = MYSQL_RESULT($result, $i, "RESOURCE_FLAGS");
$thisRESOURCE_STATE = MYSQL_RESULT($result, $i, "RESOURCE_STATE");
$thisRESOURCE_SIZE = MYSQL_RESULT($result, $i, "RESOURCE_SIZE");
$thisDATE_CONTENT = MYSQL_RESULT($result, $i, "DATE_CONTENT");
$thisSIBLING_COUNT = MYSQL_RESULT($result, $i, "SIBLING_COUNT");
$thisDATE_CREATED = MYSQL_RESULT($result, $i, "DATE_CREATED");
$thisDATE_LASTMODIFIED = MYSQL_RESULT($result, $i, "DATE_LASTMODIFIED");
$thisUSER_CREATED = MYSQL_RESULT($result, $i, "USER_CREATED");
$thisUSER_LASTMODIFIED = MYSQL_RESULT($result, $i, "USER_LASTMODIFIED");
$thisPROJECT_LASTMODIFIED = MYSQL_RESULT($result, $i, "PROJECT_LASTMODIFIED");
$thisRESOURCE_VERSION = MYSQL_RESULT($result, $i, "RESOURCE_VERSION");
}
}
?>
View Record<br><br>
<table>
<tr height="30">
<td align="right"><b>RESOURCE_ID : </b></td>
<td><?php
echo $thisRESOURCE_ID;
?>
</td>
</tr>
<tr height="30">
示例15: MYSQL_RESULT
<?php
} else {
if ($numberOfRows > 0) {
$i = 0;
$thisPLUGIN_NAME = MYSQL_RESULT($result, $i, "PLUGIN_NAME");
$thisPLUGIN_VERSION = MYSQL_RESULT($result, $i, "PLUGIN_VERSION");
$thisPLUGIN_STATUS = MYSQL_RESULT($result, $i, "PLUGIN_STATUS");
$thisPLUGIN_TYPE = MYSQL_RESULT($result, $i, "PLUGIN_TYPE");
$thisPLUGIN_TYPE_VERSION = MYSQL_RESULT($result, $i, "PLUGIN_TYPE_VERSION");
$thisPLUGIN_LIBRARY = MYSQL_RESULT($result, $i, "PLUGIN_LIBRARY");
$thisPLUGIN_LIBRARY_VERSION = MYSQL_RESULT($result, $i, "PLUGIN_LIBRARY_VERSION");
$thisPLUGIN_AUTHOR = MYSQL_RESULT($result, $i, "PLUGIN_AUTHOR");
$thisPLUGIN_DESCRIPTION = MYSQL_RESULT($result, $i, "PLUGIN_DESCRIPTION");
$thisPLUGIN_LICENSE = MYSQL_RESULT($result, $i, "PLUGIN_LICENSE");
$thisLOAD_OPTION = MYSQL_RESULT($result, $i, "LOAD_OPTION");
}
}
?>
<h2>Update PLUGINS</h2>
<form name="pluginsUpdateForm" method="POST" action="updatePlugins.php">
<table cellspacing="2" cellpadding="2" border="0" width="100%">
<tr valign="top" height="20">
<td align="right"> <b> PLUGIN_NAME : </b> </td>
<td> <input type="text" name="thisPLUGIN_NAMEField" size="20" value="<?php
echo $thisPLUGIN_NAME;
?>
"> </td>
</tr>