sql - UPDATE database with PHP - not working -
my goal change value in "commission" column 'open' 'closed' when update table 'status'.i can't seem db update. not errors. doing wrong?
this code submit button:
if($result["commissions"]=='open'){ echo '<form method="post" action="admin_main.php"> <input name="commissionsc" type="submit" value="close comissions" /> </form>'; }
this part of code not working:
<?php include("includes/connect.php"); if(isset($_post['comissionsc'])){ $res= mysql_query("select * status"); $row= mysql_fetch_array($res); $sql="update status". "set commissions = 'closed'". "where id = 1"; } ?>
change query to:
$sql = mysql_query("update status set commisions = 'closed' id = 1");
you're not executing query.
footnotes:
mysql_*
functions deprecation notice:
http://www.php.net/manual/en/intro.mysql.php
this extension deprecated of php 5.5.0, , not recommended writing new code removed in future. instead, either mysqli or pdo_mysql extension should used. see mysql api overview further while choosing mysql api.
these functions allow access mysql database servers. more information mysql can found @ » http://www.mysql.com/.
documentation mysql can found @ » http://dev.mysql.com/doc/.
Comments
Post a Comment