Solved

Valid output values for a PHP/MySQL update statement

Posted on 2008-10-06
2
322 Views
Last Modified: 2013-12-13
Hey folks,

I have a program I'm working on to automate updating of various types of data. I basically have a form, with a button that allows anyone in the HR department to click it and automatically run an update query based on pre-defined values.

My question is, I know (or rather, as far as I'm aware) update normally just returns a boolean value of true/false on success/failure, but is it possible to output to the browser the values that were updated? Or even, how many lines were updated?

For example, if hitting the button would update 10 lines in a given table, is it possible to either, A) output which lines were updated, or B) simply output "10 lines updated" etc.

Thanks!
James
0
Comment
Question by:jmoriarty
2 Comments
 
LVL 14

Accepted Solution

by:
ali_kayahan earned 500 total points
ID: 22648923
Hi jmoriarty; You can get the affected row counts just running  ;
     
     mysql_affected_rows() ;

  After your query , so you can log it or output...
 
0
 

Author Comment

by:jmoriarty
ID: 22656174
Hi aly_kayahan,

Thanks, that's exactly what I was looking for!

0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question