Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

add one value to all records in mysql

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

add one value to all records in mysql

Postby aburaminet » Mon Jan 14, 2013 4:34 am

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

Image

Code: Select all
 
  <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: Select all
$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());
}
aburaminet
New php-forum User
New php-forum User
 
Posts: 1
Joined: Mon Jan 14, 2013 4:15 am

Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron