0

this is my php code:

<?php       
    if(isset($_POST['update'])){
         $idid=$_POST['i_d'];     
         $v=$_POST['vvv'];  
         $course=$_POST['courseu'];
        $sts=$_POST['statuesupdate']; 

     $query ="UPDATE `application_process` a left join `oferte` o on(a.`oferteid`= o.`idoferta`) SET a.`app_status`='$sts' where 
      a.`app_course`='$course' AND a.`oferteid`='$idid'" ; 
      $Recordset55 = mysql_query($query);
       if($Recordset55){
        echo $v;
       }
    }
    ?>

this is my modal htmlcode:

<div class="modal fade bs-example-modal-sm" tabindex="-1"  id="myModal<?php echo $row_Recordset550['idoferta']; ?>">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">x</span>
       </button>
        <h4 class="modal-title" id="mySmallModalLabel">Update statues</h4>
      </div>
      <div class="modal-body">  
       <input type="text" name="i_d" value="<?php echo $id; ?>"   />
        <input type="text" name="vvv" value="<?php echo $row_Recordset550['id']; ?>"   />
       <input type="text" name="courseu" value="<?php echo $row_Recordset550['app_course']; ?>" />
        <select name="statuesupdate">
         <option value=""> -- Select Status --</option>
<option value="Under Processed">Active(UnderProcessed)</option> 
 <option value="processed">Closed(Processed)</option>
  <option value="pending">Pending</option>  
        </select>
       <input type="submit" name="update" value="update" class="btn btn-sm btn-warning">
      </div>
    </div>
  </div>
</div>

this is my php and html code plese help me query is run successful bt data is not update and when print the id that time garbage value is print so how can my code update

this is my code open a tag

<td><a href="#myModal<?php echo $row_Recordset550['idoferta'];?>"   class="btn btn-sm btn-danger" data-toggle="modal" >Edit</a></td>
kajal jethva
  • 72
  • 10
  • Don't use the `mysql_*` functions. They have been deprecated since v5.5 (Jun 2013) and removed since v7.0 (Dec 2015). Instead use the [**mysqli_***](https://secure.php.net/manual/en/book.mysqli.php) or [**PDO**](https://secure.php.net/manual/en/book.pdo.php) functions with [**prepared statements**](https://secure.php.net/manual/en/pdo.prepare.php) and [**bound parameters**](https://secure.php.net/manual/en/pdostatement.bindparam.php). – Alex Howansky Oct 13 '17 at 14:17
  • Your code is vulnerable to [**SQL injection**](https://en.wikipedia.org/wiki/SQL_injection) attacks. You should use prepared statements with bound parameters, via either the [**mysqli**](https://secure.php.net/manual/en/mysqli.prepare.php) or [**PDO**](https://secure.php.net/manual/en/pdo.prepared-statements.php) drivers. [**This post**](https://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php) has some good examples. – Alex Howansky Oct 13 '17 at 14:17
  • bt in other query used my_sql fuction for ex select and insert query i have used a my sql function so it possible to update i used the my_sqli function??? @AlexHowansky – kajal jethva Oct 14 '17 at 04:44

0 Answers0