Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Whats an equivalent to mysql_num_rows, oci_num_rows doesn't do the same.

780188Jun 22 2010 — edited Jun 28 2010
So i have checked all over google and I can' find anything that works the same as mysql_num_rows. I tried oci_num_rows but it just doesn't work the same.

The code below worked in mysql, it works and updates now in oracle, however. The part below where it compares how many rows are being used won't work anymore. It just shows up as updated every time. I am only looking for the rows that have changed. If my staff member doesn't update anything I have it show up and say. " You profile hasn't changed nothing was updated"

if ($rowsAffected == 0) This is the part here that I can't get to work properly which is down below as you can see.

Do i need to use some kind of count. Could someone give an example please.



f($error==0){
$updateQuery = "UPDATE staffMember
SET smFirstName = '$smFirstName',
smLastName = '$smLastName',
smPhone = '$smPhone',
smAddress = '$smAddress',
smCity = '$smCity',
smState = '$smState',
smZip = '$smZip',
smEmail = '$smEmail',
smExperience = '$smExperience',
smEducation = '$smEducation',
smSchool = '$smSchool',
smCertification = '$smCertification',
smAvailability = '$smAvailability',
smStatus = '$smStatus',
smTravel = '$smTravel',
smSalary = '$smSalary',
smEmployer = '$smEmployer',
smPositionType = '$smPositionType',
smYearsWorked = '$smYearsWorked',
smSkills = '$smSkills',
smHobbies = '$smHobbies',
smProfileImage = '$smProfile_Image',
smUploadResume = '$smUpload_Resume',
smPassword = '$smPassword'
WHERE staffMemberId = '{$staffID}'";

//$result = mysql_query($updateQuery);
//confirm_query($result);
$result = oci_parse($conn, "$updateQuery");
oci_execute($result);
$rowsAffected = oci_num_rows($result);

if ($rowsAffected == 0) {
redirect_to("staffArea.php?update=2");
} else if ($rowsAffected != -1) {
redirect_to("staffArea.php?update=1");
} else {
$message .= "Error occurred while updating database. Please try again.";
}

}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 26 2010
Added on Jun 22 2010
5 comments
3,723 views