close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

mysql + php question

Thread began 1/04/2010 12:48 pm by gruant2000381341 | Last modified 1/05/2010 5:54 am by gruant2000381341 | 1370 views | 2 replies |

gruant2000381341

mysql + php question

I built a db with a table, one of the columns is named "received". It has a default of 0, after a user has entered their info this value increases to 1....it's an either 0 or 1 value only. I am trying to find out how to reset that whole column to 0 once all users have entered their info with php. I have been reading up but can't find what I need that won't wipe out the other columns also. Any ideas?

Sign in to reply to this post

Jason ByrnesWebAssist

Use the Data ASSIST wizard to create the update statement.
For the index column, select the received column, enter 1 for value, this will update all records where the recieved column has a value of 1.

On the second page, select the received column and enter the value 0 so it wilkl be updated to 0. Only the columns you specify a value for will be updated, so do not set a value for any of the other columns.


Create a record to count the number of entries where the received column equals 0:
SELECT COUNT(id) as recievedCount WHERE received = 1

Then add an if statement around the update record server behavior so it will only trigger if the recievedCount = 0:

php:
<?php if($row_recordsetName['recievedCount '] == 0) { ?>

<?php
...update record code...
?>
<?php 
?>
Sign in to reply to this post

gruant2000381341

great idea, thanks

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...