php - can't update database, anything would be appreciated -


i built office, php code

when built on apache worked fine, when uploaded server i'm getting pod or mysqli errors, fixed (by using "error_reporting(e_all ^ e_deprecated);" on top, , worked)

the problem i'm having can't update database did on apache, doesn't update. give me ok message doesn't update anything.

this code:

<?php mysqli_connect('localhost','username','password','table');  if(isset($_post["register"])) {  $status=$_post["status"];  mysqli_query("update login set status='$status' username='".$_session['name_of_user']."'");   echo "<font face=tahoma size=3 color=red>thank you, office has been updated.</br></font>";  } mysqli_close($con);  ?>   <form method="post" action=" ">  <font face=tahoma size=3><b>  <label >update status:</label> </br>  <select name="status">  <option value="in meeting">in meeting</option>  <option value="waiting meeting">waiting meeting</option>  <option value="in referral">in referral</option>  <option value="off work">off work</option>   </select>   <button type="submit" class="btn btn-info" name="register" >send</button> </br> </font> </form> 

please help! thank , have great weekend!

seems forgot start session in page

<?php  session_start(); 

and mysqli_connect('localhost','username','password','table'); should mysqli_connect('localhost','username','password','your_database_name');

$con =mysqli_connect('localhost','username','password','your_database_name');  mysqli_query($con,"update login set status='$status' username='".$_session['name_of_user']."'");  

Comments