Jump to content

update not working


Spraban9

Recommended Posts

hi friends

this coding is not working

<center>



<?php

if($_POST['name'] != ''  && $_POST['comf'] != ''){
    
$name=$_POST['name'];
$comf = $_POST['comf'];  
 include("include/connection.php");
        
    if (!$conn)    {
                die('Could not connect: ' . mysql_error());
            }
            
            mysql_select_db($database , $conn) or die (mysql_error());
            
        $result = mysql_query("select user,randomno from customer where user = '$name' and randomno='$comf'");
        if(mysql_num_rows($result)>0)
        {
            
 mysqli_query("UPDATE customer SET active = 1 WHERE user='$name' ") or die(mysql_error());

        }
}
?>
<form name="frmconfor"  id="frmconfor" method="post" action="comformation.php">
 
   
         <table width="536" height="265" id="font"  >
      
        <tr>
          <td height="62" class="style9"><label>UserName</label></td>
          <td><input required name="name" type="text" value=""  /></td>
        </tr>
        <tr>
          <td height="62" class="style9"><label>Conformation Code</label></td>
          <td><input required name="comf" type="text" value=""  /></td>
        </tr>
       
         <tr>
           <td height="118" colspan="2">
             <div align="center">
               <input name="submit" type="submit"  value="submit"/>
             
            </div></td>
         </tr>
    </table>
        
    
         
        
</form></center>

 

Link to comment
https://forums.phpfreaks.com/topic/275970-update-not-working/
Share on other sites

<?php


if(isset($_POST['update'])){
    

$comf = $_POST['comf'];  
 include("include/connection.php");
        
    if (!$conn)    {
                die('Could not connect: ' . mysql_error());
            }
            
            mysql_select_db($database , $conn) or die (mysql_error());

        
     $que1="update customer set active = 1 where randomno = '$comf' " ;
    


$retval = mysql_query( $que1, $conn );
if(! $retval )
{
  die('Could not update data: ' . mysql_error());
}
echo "Updated data successfully\n";
mysql_close($conn);
}
else
{
?>
   
 <span style="float:right">Welcome to Addfreeads upload site <?php echo $name ?>
  </span>

    

 <label id="dis"> <h3><?php echo $saved?> </h3></label><br>
<form name="frmconfor"  id="frmconfor" method="post" action="<?php $_PHP_SELF ?>">
 
    <h2> Enter your Verfication code here</h2>
         <table width="536" height="265" id="font"  >
      
    
        <tr>
          <td height="62" class="style9"><label>Conformation Code</label></td>
          <td><input required name="comf" type="text" value=""  /></td>
        </tr>
       
         <tr>
           <td height="118" colspan="2">
             <div align="center">
               <input name="update" type="submit" id="update" value="Update">
             
            </div></td>
         </tr>
    </table>        
    
         
        
</form>
<?php
}
?> </center>

i change coding like this but update not working

Link to comment
https://forums.phpfreaks.com/topic/275970-update-not-working/#findComment-1420470
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.