Updaing Sql Table Using Update Mysql And Php Syntax
i am trying to update my records using UPDATE in php and mysql , the query working but there is not updates at all happened on the database , i have many records for tickets which
Solution 1:
try building the query separately (e.g. $sql = 'UPDATE ...'
, so you can do an echo $sql
and copy/paste the query and run it manually. Nothing in your code looks wrong, so the values you're passing around must not be correct or the WHERE ...
logic isn't proper. So run a sample query manually and see if anything happens then.
However, note that you're doing this inside a for()
loop, but aren't using that $counter value anywhere. In effect you're just running the SAME query over and over. Setting ticketSold
to Yes
$counter times isn't going to make it "more" Yes
than if you'd done this update only once.
Post a Comment for "Updaing Sql Table Using Update Mysql And Php Syntax"