本文整理汇总了PHP中Connection::getNumRows方法的典型用法代码示例。如果您正苦于以下问题:PHP Connection::getNumRows方法的具体用法?PHP Connection::getNumRows怎么用?PHP Connection::getNumRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connection
的用法示例。
在下文中一共展示了Connection::getNumRows方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deanIds
function deanIds()
{
$c = new Connection();
$sql_dean = "SELECT stakeholder_id, Position\n FROM stakeholderhasranks \n WHERE Rank LIKE 'Associate Dean' \n OR\n Rank LIKE 'Dean'";
$r = $c->query($sql_dean);
if ($c->getNumRows($r) != 0) {
while ($row = $c->getArray($r)) {
$temp[] = $row;
}
}
return $temp;
}
示例2: max
// on stakeholders.Stakeholder_id = addresses.Stakeholder_id
// LEFT JOIN phonenumbers
// on stakeholders.Stakeholder_id = phonenumbers.Stakeholder_id
// JOIN emailaddresses
// LEFT JOIN educationhistory
// on stakeholders.Stakeholder_id = educationhistory.Stakeholder_id
// WHERE
// stakeholders.ComputingID = TRIM('".$q_2."')";
// }
// }
// elseif (isset($_REQUEST["seeq"])){
$lastname = $_REQUEST["lastname"];
$sql4 = "\n SELECT max(Stakeholder_id) FROM stakeholders WHERE LastName LIKE TRIM('.{$lastname}.')\n ";
$r = $c->query($sql4);
$col = count($c->getArray($r)) - 1;
if ($c->getNumRows($r) != 0) {
while ($col) {
$row1 = $c->getArray($r);
$l = $row1;
$col = $col - 1;
}
}
$c->close();
echo $l;
//////////////////////////////
// else {
// $ar=array();
// $ar = explode('-',$q_2);
// $arrayLenght= count($ar)-1;
// $sthid= $ar[$arrayLenght];
session_start();
示例3: while
$institution_name1 = $_REQUEST["institution_name"];
$institution_name2 = $_REQUEST["institution_name2"];
$institution_name3 = $_REQUEST["institution_name3"];
$institution_name_city_1 = $_REQUEST["institution_name_city_1"];
$institution_name_city_2 = $_REQUEST["institution_name_city_2"];
$institution_name_city_3 = $_REQUEST["institution_name_city_3"];
$country_edu_1 = $_REQUEST["country_edu_1"];
$country_edu_2 = $_REQUEST["country_edu_2"];
$country_edu_3 = $_REQUEST["country_edu_3"];
$currently_employed = $_REQUEST["currently_employed"];
$position = $_REQUEST["position"];
$prefer = "Yes";
//////////////////////////// To check is there exist a preferd address or not/////////////////////////////////////////////////////////////
$srt_add = "select Address_id from addresses where addresses.Stakeholder_id = '" . $sth_id . "' and addresses.Preferred = 'Yes' ";
$r57_add = $c->query($srt_add);
if ($c->getNumRows($r57_add) != 0) {
while ($row_add = $c->getArray($r57_add)) {
$tem_add[] = $row_add;
}
}
foreach ($tem_add as $name_add) {
$hi_add['Address_id'] = $name_add['Address_id'];
}
if ($hi_add['Address_id'] > 1) {
$sql7 = "UPDATE addresses SET \n Address1 = '{$address1}',\n City = '{$city}',\n Province = '{$state}',\n Country = '{$country}',\n PostalCode = '{$postal_code}',\n moved_from = '{$moved_from}',\n Type = '{$add_type}',\n Preferred = '{$prefer}'\n WHERE addresses.Stakeholder_id = '" . $sth_id . "' AND addresses.Preferred = 'Yes' ";
} else {
$sql7 = "INSERT INTO addresses (Stakeholder_id,Address1,City,Province,Country,PostalCode,moved_from,Type,Preferred )" . " values ('{$sth_id}','{$address1}','{$city}','{$state}','{$country}','{$postal_code}','{$moved_from}','{$add_type}','{$prefer}')";
}
//echo "sql7=== ".$sql7;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////// To check is there exist a preferd emaill address or not/////////////////////////////////////////////////////////////
示例4: Connection
$(function() {
$( "#payroll_start_date" ).val("12/12/12");
$( "#payroll_start_date" ).datepicker();
$( "#payroll_start_date" ).datepicker( "option", "showAnim", 'bounce');
});
</script>-->
<?php
$c = new Connection();
$sql = "\t\t\n select Name FROM bus_pad_lut where bus_pad_lut.Area = 'Area'";
$result = $c->query($sql);
if ($c->getNumRows($result) != 0) {
while ($row = $c->getArray($result)) {
$lisi[] = $row;
}
}
$c->close();
// $hint = "";
// foreach($lisi as $name) {
// $hint['Name'] = $name['Name'];
// }
?>
<div class="col-md-3 ">
<label for = "department2"> Second Department </label>
示例5: Connection
}
if (!$access->allowAccessType($acess_array) && $access->IsInstructor()) {
$layout->generateInstructorHeader();
} else {
$layout->generateHeader();
}
//echo $_SESSION['sms_userComputingID'];
$sthid = $_SESSION['sms_userStakeholderID'];
//echo $_SESSION['sms_userName'];
// $sthid = 10159;
$sthid = 10724;
$c = new Connection();
$h = '';
$sql = "SELECT * FROM stakeholders WHERE stakeholder_id = '" . $sthid . "' ";
$result = $c->query($sql);
if ($c->getNumRows($result) == 0) {
return false;
}
while ($row = $c->getArray($result)) {
$h['LastName'] = $row['LastName'];
$h['FirstName'] = $row['FirstName'];
}
///////////////////////////////////////////// Start find department ////////////////////////////////////////////////////////////////////////
$count_deps = 0;
$sql_dep = "SELECT * \n FROM stakeholderhasranks sth\n LEFT JOIN bus_rank_has_pad brhp ON sth.ranks_id = brhp.rank_id\n LEFT JOIN bus_pad_lut bpl ON bpl.pad_id = brhp.pad_id \n INNER JOIN bus_rank_lut AS brl ON sth.Rank = brl.Rank AND brl.EmploymentGroupNumNew = 1\n WHERE sth.stakeholder_id = '" . $sthid . "' \n AND (DATE(NOW()) > sth.StartDate \n OR (sth.StartDate = '0000-00-00' )\n OR (sth.StartDate IS NULL ) )";
$results_dep = $c->query($sql_dep);
// if($c->getNumRows($results_dep) == 0)
// return false;
while ($rows = $c->getArray($results_dep)) {
$h['Name' . $count_deps] = $rows['Name'];
$h['PrimaryRank' . $count_deps] = $rows['PrimaryRank'];
示例6: Connection
<?php
include_once "../sms/admin/_inc/config.php";
include_once "../sms/admin/_theme/Theme.php";
include_once "../sms/admin/_controllers/UserAccessController.php";
include_once "../sms/admin/_models/Courses.php";
include_once "../sms/admin/_models/Contract-Teaching.php";
include_once "../sms/admin/_inc/helper.php";
include_once "../sms/admin/_controllers/SimpleDataEntryController.php";
//$c = new Connection();
$c = new Connection();
#For a given date, identify the term it belongs to
//SELECT * FROM `terms_lut` WHERE '2015-06-03' BETWEEN StartDate AND EndDate
$srt7 = "select * from stakeholderhasranks where stakeholderhasranks.stakeholder_id = '" . $s . "' ";
//echo $srt7;
$r57 = $c->query($srt7);
if ($c->getNumRows($r57) != 0) {
while ($row97 = $c->getArray($r57)) {
$temq2[] = $row97;
}
}
foreach ($temq2 as $name) {
$hi97['ranks_id'] = $name['ranks_id'];
}
$sql = " INSERT INTO limited_term \n (Stakeholder_id,department,department2) \nVALUES ('{$s}','{$department}','{$department2}')";
if ($c->query($sql) === TRUE) {
// echo "New record created successfully"."<br />".$_SESSION['sfuid']."<br />".$sql;
} else {
// echo "Error: " . $sql . "<br>" . $c->error;
}
示例7: explode
session_start();
// it searches by lastname and gives you stakeholder_id, if two people are same last name its your duty to tell which one is correct one!
// by checking sfu_id or email address
// .
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// First part search with last Name //////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// In this file we send html tables and buttoms to the source file, so each button has id upon on his limited term id thus we can customize it (unable edditable or delete button) /////
$h = "";
if ($_REQUEST["srch_lmt"] != "") {
//echo "1_____________________________________________________________________________________________";
$ar = explode('-', trim($q_2));
// echo "sfu_id =".$ar[3];
$stakeholder_id = "SELECT stakeholder_id,LastName,FirstName,Emplid FROM stakeholders where stakeholders.Emplid = ('" . $ar[3] . "')";
$res = $c->query($stakeholder_id);
if ($c->getNumRows($res) != 0) {
while ($row1 = $c->getArray($res)) {
$list1[] = $row1;
}
}
$hint1 = "";
if ($stakeholder_id !== "") {
foreach ($list1 as $name1) {
$hint1['stakeholder_id'] = $name1['stakeholder_id'];
$hint1['LastName'] = $name1['LastName'];
$hint1['FirstName'] = $name1['FirstName'];
$hint1['Emplid'] = $name1['Emplid'];
}
}
$s_id = $hint1['stakeholder_id'];
$_SESSION['sta_id'] = $s_id;
示例8: stakeholders
} else {
if ($flag_noplid) {
$sql2 = "INSERT INTO stakeholders (LastName,FirstName,PreferredFirstName, Citizenship , Gender, VisaExpireyDate, Residency, CitizenshipStatus, MiddleName)" . "values ('" . $last_name . "', '" . $first_name . "', '" . $preferredFirstName . "','" . $citizenship . "'," . "'" . $gender . "','" . $visa . "','" . $Residency . "','" . $CitizenshipStatus . "','{$middle_name}')";
}
}
session_start();
if ($c->query($sql2) === TRUE) {
// echo "New record created successfully";
} else {
// echo "Error: " . $sq2 . "<br>" . $c->error;
}
/*followed by retriving the stakeholder_id */
$stakeholder_id = "SELECT MAX(stakeholder_id) FROM stakeholders ";
$list1 = '';
$res = $c->query($stakeholder_id);
if ($c->getNumRows($res) != 0) {
while ($row1 = $res->fetch_assoc()) {
//$row1 = $c->getArray($res);
// echo " ".$n."=".$row1['MAX(stakeholder_id)'];
$list1[] = $row1['MAX(stakeholder_id)'];
// $list['LastName'];
// echo "list= ".$list1[n];
}
}
$s_id = $list1[0];
// Insert address info into addresses table
// $s_id = 973009081;
$sql4 = "INSERT INTO addresses (Stakeholder_id,Address1,City, Province,Country, PostalCode,Type,moved_from ) values ('{$s_id}','{$address1}','{$city}','{$address_state}','{$addrss_country}','{$postal_code}', '{$type}','{$moved_from}')";
$sql5 = "INSERT INTO phonenumbers (Stakeholder_id,Phonenumber) values ('{$s_id}','{$pn}')";
$sql6 = "INSERT INTO emailaddresses (Stakeholder_id,EmailAddress,Preferred) values ('{$s_id}','{$email}','Yes')";
if ($c->query($sql4) === TRUE && $c->query($sql5) === TRUE && $c->query($sql6) === TRUE) {
示例9: Connection
}
if (!$access->allowAccessType($acess_array) && $access->IsInstructor()) {
$layout->generateInstructorHeader();
} else {
$layout->generateHeader();
}
//echo $_SESSION['sms_userComputingID'];
$sthid = $_SESSION['sms_userStakeholderID'];
//echo $_SESSION['sms_userName'];
//$sthid = 10724;
// $sthid = 10724;
$c = new Connection();
$h = '';
$sql = "SELECT * FROM stakeholders WHERE stakeholder_id = '" . $sthid . "' ";
$result = $c->query($sql);
if ($c->getNumRows($result) == 0) {
return false;
}
while ($row = $c->getArray($result)) {
$h['LastName'] = $row['LastName'];
$h['FirstName'] = $row['FirstName'];
}
///////////////////////////////////////////// Start find department ////////////////////////////////////////////////////////////////////////
$count_deps = 0;
$sql_dep = "SELECT * \n FROM stakeholderhasranks sth\n LEFT JOIN bus_rank_has_pad brhp ON sth.ranks_id = brhp.rank_id\n LEFT JOIN bus_pad_lut bpl ON bpl.pad_id = brhp.pad_id \n INNER JOIN bus_rank_lut AS brl ON sth.Rank = brl.Rank AND brl.EmploymentGroupNumNew = 1\n WHERE sth.stakeholder_id = '" . $sthid . "' \n AND (DATE(NOW()) > sth.StartDate \n OR (sth.StartDate = '0000-00-00' )\n OR (sth.StartDate IS NULL ) )";
$results_dep = $c->query($sql_dep);
// if($c->getNumRows($results_dep) == 0)
// return false;
while ($rows = $c->getArray($results_dep)) {
$h['Name' . $count_deps] = $rows['Name'];
$h['PrimaryRank' . $count_deps] = $rows['PrimaryRank'];
示例10: count
$arrayLenght = count($ar) - 1;
$sthid = $ar[$arrayLenght];
//}
//}
session_start();
if (isset($_SESSION["sta_id"])) {
unset($_SESSION["sta_id"]);
}
// I changed from $_Sessopm["sta_id"] = $sthid to below
$_SESSION["sta_id"] = $sthid;
// $sthid = 10754;
$cosi['max(limited_term_id)'] = 0;
$sql6 = "SELECT max(limited_term_id) FROM limited_term WHERE Stakeholder_id LIKE TRIM('{$sthid}')";
// $rese = ($c->query($limited_term_id));
$rese = $c->query($sql6);
if ($c->getNumRows($rese) != 0) {
while ($rolin = $c->getArray($rese)) {
$cosi[] = $rolin;
}
}
$hmn = "";
foreach ($cosi as $n) {
$hmn['max(limited_term_id)'] = $n['max(limited_term_id)'];
}
$lim_id = $hmn['max(limited_term_id)'];
// $lim_id = 386;
// foreach ($r as $trow)
// {
// echo "ooooyoooooooooo".$trow['max(Stakeholder_id)'];
// }
// $c->close()
示例11: while
$funding_source = $_REQUEST["funding_source"];
$details = $_REQUEST["details"];
$position = $_REQUEST["position"];
$position1 = $_REQUEST["position1"];
$position2 = $_REQUEST["position2"];
$highest_degree_1 = $_REQUEST["highest_degree_1"];
$jv = $_REQUEST["jv"];
$_SESSION["sta_id"] = $_REQUEST["sta_id"];
$s = $_SESSION["sta_id"];
$salary_step = $_REQUEST["salary_step"];
// Here we check whether this stackholder id is saved in our database or not
// final version of getting things from an array!!!!!!
$srt7 = "select * from stakeholderhasranks where stakeholderhasranks.stakeholder_id = '" . $s . "' ";
echo $srt7;
$r57 = $c->query($srt7);
if ($c->getNumRows($r57) != 0) {
while ($row97 = $c->getArray($r57)) {
$temq2[] = $row97;
}
}
foreach ($temq2 as $name) {
$hi97['ranks_id'] = $name['ranks_id'];
}
if ($hi97['ranks_id']) {
$sql_22 = "UPDATE stakeholderhasranks SET StartDate='" . $appointment_start_date . "' , EndDate='" . $appointment_end_date . "' where stakeholderhasranks.stakeholder_id= '" . $s . "'";
if ($c->query($sql_22) === TRUE) {
echo "UPDATE ";
} else {
echo "Error: ";
}
} else {
示例12: explode
<?php
include_once "../sms/admin/_inc/config.php";
include_once "../sms/admin/_theme/Theme.php";
include_once "../sms/admin/_controllers/UserAccessController.php";
include_once "../sms/admin/_models/Courses.php";
include_once "../sms/admin/_models/Contract-Teaching.php";
include_once "../sms/admin/_inc/helper.php";
include_once "../sms/admin/_controllers/SimpleDataEntryController.php";
$stat = $_REQUEST['status_of_lmt'];
//echo "_____________".$stat."____________";
$arr = explode(", ", $stat);
$lmtID = TRIM($arr[1]);
$status = TRIM($arr[0]);
$c = new Connection();
$sql = "UPDATE limited_term SET limited_term.status_of_lmt= '{$status}' WHERE limited_term.limited_term_id = '" . $lmtID . "' ";
$result = $c->query($sql);
$c->getNumRows($result);
$c->close();
echo $stat;
示例13: get_rand_id
$error['email'] = 'Please Enter Email';
$error_flag = 1;
}
$email = $_POST['email'];
if (!eregi("^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})\$", $email) && !empty($_POST['email'])) {
$error['email'] = 'Please Enter Valid Email';
$error_flag = 1;
}
$msg = "";
if ($error_flag == 0) {
$connObj = new Connection($db->Host, $db->User, $db->Password, $db->Database);
$strNewPassword = get_rand_id(6);
$encryptPwd = $strNewPassword;
// Check if email exists in the database
$where = " where `uemail` = '" . $_POST['email'] . "'";
$NumRows = $connObj->getNumRows(TBL_ADMIN, $where);
if ($NumRows > 0) {
$user = $connObj->getSingleRow(TBL_ADMIN, "where uemail='" . $_POST['email'] . "'");
$sql = mysql_query("UPDATE " . TBL_ADMIN . " set password = '" . $encryptPwd . "' where uemail='" . $_POST['email'] . "'") or die(mysql_error());
//Send email for notification
sendmail($_POST['email'], $strNewPassword, $user['username'], $user['status']);
$msg = "<div class='error'>Your password has been reset and mailed to you on your registered email id.</div>";
} else {
$msg = "<div class='error'>User not found. Please try again.</div>";
}
}
}
//generate random string
function get_rand_id($length)
{
if ($length > 0) {
示例14: Connection
include_once "../sms/admin/_controllers/UserAccessController.php";
include_once "../sms/admin/_models/Courses.php";
include_once "../sms/admin/_models/Contract-Teaching.php";
include_once "../sms/admin/_inc/helper.php";
include_once "../sms/admin/_controllers/SimpleDataEntryController.php";
//$c = new Connection();
$c = new Connection();
#For a given date, identify the term it belongs to
//SELECT * FROM `terms_lut` WHERE '2015-06-03' BETWEEN StartDate AND EndDate
$leave_option_id = $_REQUEST['leave_option_id'];
$sth_id = $_REQUEST['sth_id'];
// this hardcode is only for test
//$sth_id = 10724;
$srt7 = "select * from bus_tp_journal where bus_tp_journal.Stakeholder_Id = '" . $sth_id . "' ";
$r57 = $c->query($srt7);
if ($c->getNumRows($r57) != 0) {
while ($row97 = $c->getArray($r57)) {
$temq2[] = $row97;
}
$count_teaching = 0;
foreach ($temq2 as $name) {
$hi97['StartTerm'][] = $name['StartTerm'];
// $hi97['EndTerm'][] = $name['EndTerm'];
// $hi97['Code_Id'][] = $name['Code_Id'];
// echo "Type= ".gettype($name['StartTerm']);
$year = substr($name['StartTerm'], 0, 3);
$term = substr($name['StartTerm'], 3, 4);
$term = intval($term);
if ($term == 4) {
$term = 2;
} else {
示例15: unset
if (isset($_SESSION['sta_id_q2'])) {
unset($_SESSION['sta_id_q2']);
}
if (isset($_SESSION['sta_id'])) {
unset($_SESSION['sta_id']);
}
$q_22 = $_REQUEST["q1_data"];
// echo nl2br("\n");
// if(strrpos($q_22, "sfu.ca") || strrpos($q_22, "SFU.CA")){
$q_22 = strstr($q_22, "@", true);
//$q_22 ="wuschke";
//
$srt7 = "select stakeholder_id from stakeholders where stakeholders.ComputingID = '" . $q_22 . "' ";
//echo $srt7;
$r57 = $c->query($srt7);
if ($c->getNumRows($r57) != 0) {
while ($row97 = $c->getArray($r57)) {
$temq2[] = $row97;
//$_SESSION['sta_id']= $row97['stakeholder_id'];
}
}
foreach ($temq2 as $name) {
$hi97['stakeholder_id'] = $name['stakeholder_id'];
}
$_SESSION['sta_id'] = $hi97['stakeholder_id'];
//$_SESSION['sta_id'] = $hi97['stakeholder_id'];
//echo "session=".$_SESSION['sta_id'];
$sql = "\t\t\n select *\n From stakeholders \n LEFT JOIN addresses \n on stakeholders.Stakeholder_id = addresses.Stakeholder_id \n LEFT JOIN phonenumbers\n on stakeholders.Stakeholder_id = phonenumbers.Stakeholder_id\n JOIN emailaddresses\n LEFT JOIN educationhistory\n on stakeholders.Stakeholder_id = educationhistory.Stakeholder_id \n WHERE\n stakeholders.ComputingID = TRIM('" . $q_22 . "')";
$resultdata = $c->query($sql);
echo $sql;
$codata = count($c->getArray($resultdata)) - 1;