PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 14th, 2013, 10:14 AM
aburaminet aburaminet is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 1 aburaminet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 23 sec
Reputation Power: 0
PHP-General - Add one value to all records in mysql

Hi everyone, I'm sult, I want to ask you a question, I'm create table takes values ​​from databases(MySQL) and print all the fields from the database, after presenting this information I want to make the user to this application by simply pressing a button will increase the value in the field as well by one and store the values in Mysql, also I want to add another button to give the value zero in column addition to all fields, can u please explain to me how to do it?
And I'll show you some code to design the currency
* Note I use Dreambox Weaver as an assistant to me in programming
Thank you

URL

Code:
      <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
     <?php do { ?>
        <tr bgcolor="#FFFFFF" style="text-align:center">
         
           
         
          <td nowrap="nowrap"><?php echo $row_rs_add_std['stnum']; ?></td>
          <td nowrap="nowrap"><?php echo $row_rs_add_std['stname']; ?> </td>
          <td nowrap="nowrap"><?php echo $row_rs_add_std['stnum']; ?></td>
         
          <ol><td nowrap="nowrap"> </td></ol>
         
        </tr>

        <?php } while ($row_rs_add_std = mysql_fetch_assoc($rs_add_std)); ?>


Code:
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }

    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
      $updateSQL = sprintf("UPDATE studentstab SET Additions=%s WHERE stnum=%s",
                         
                           GetSQLValueString($_POST['Additions'], "int"),
                         
                           GetSQLValueString($_POST['stnum'], "int"));

      mysql_select_db($database_conmk, $conmk);
      $Result1 = mysql_query($updateSQL, $conmk) or die(mysql_error());
    }

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP-General - Add one value to all records in mysql

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap