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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.