Solved

Valid output values for a PHP/MySQL update statement

Posted on 2008-10-06
2
318 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
php string detection problem 7 33
Attach to file (img) a unique id 8 24
two ways encryption with php 3 25
Which userID to use for shopping cart application 13 19
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

776 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