PHP Code

Results 1 to 2 of 2
  1. #1
    Enthusiast DaTweekaz is offline
    MemberRank
    Jun 2015 Join Date
    New York, USALocation
    34Posts

    ! PHP Code

    Hello,

    I'm trying to make this work so if i press on a this button, a table inside the database change (A text change from one to another)

    But it wont work? What do i do wrong?

    Code:
    										<?php
    			$q = mysql_query("SELECT * FROM hk_issues");
    				while ($m = mysql_fetch_array($q)) { 
    			
    			?>
    
    <a href = "{url}/index.php?url=hk&staff&deny&id=<?php echo $m['id']; ?>">Change</a>		
    	
    
    
    		  <?php } 
    				if(isset($_GET['deny'])){
    					if($_GET['username'] == 'Test'){
    						$logtest = "INSERT INTO hk_logs (type, time, who_done) VALUES('Attempted to fire user(" . $_GET['username'] .")','". time() ."','{$_SESSION['user']['username']}')";
    						echo '<div class = "alert">You cannot do that</div>';
    						mysql_query ($logtest);
    					}
    					
    					else{
    						$qdeny = "INSERT INTO hk_logs (type, time, who_done) VALUES('Staff Application " . $_GET['username'] ."','". time() ."','{$_SESSION['user']['username']}')";
    						mysql_query("UPDATE hk_issues SET resolved = 'Deny!' WHERE id = '" . $_GET['id'] . "'");
    						mysql_query($qdeny);
    						echo('<div class = "alert">User text changed successfully.<meta http-equiv="refresh" content="3;url={url}/index.php?url=hk&staff"/></div>');
    					}
    			}
    		  ?>
    I'm trying to make so resolved inside hk_issues in my DB change from "Accepted" to "Deny" and change resolvedc (It have enum('0', '1') inside the DB. So it should change from 0 to 1 when it change (When i press the button)


    Any idea how to do this?


  2. #2
    Evil Italian Overlowrd Droppy is offline
    [Internal Coder]Rank
    Feb 2012 Join Date
    /home/droppyLocation
    2,078Posts

    Re: PHP Code

    Use the correct tag next time.



Advertisement