Jump to content

Fields not being updated


cliftonbazaar

Recommended Posts

Wierd thing has happened and I am stumped as too what is causing it.

 

I have a SQL statement that is only updating certain fields, my code is -

 $sql = "UPDATE matches
  SET bat2 = '{$match['homeTeam']}', inningsScore1 = '{$currentScore}', display1stInningsScore = '{$temp}', awayTotalScore = '{$currentScore}', currentBowler='{$match['homeOpeningBowler']}', waitingBowler='{$match['homeOtherBowler']}', currentWickets=0, batterStriker=1, batterNonStriker=2, batterOnStrike=1, ballAge=0, currentInningsScore=0, currentInnings='{$match['currentInnings']}'
  WHERE matchID='{$match['matchID']}'

 

if I echo the sql statement just before it updates then it shows the following

 

UPDATE matches
  SET bat2 = 'Darwin Desserters', inningsScore1 = '0', display1stInningsScore = '0', homeTotalScore = '0', currentBowler='11', waitingBowler='10', currentWickets=0, batterStriker=1, batterNonStriker=2, batterOnStrike=1, ballAge=0, currentInningsScore=0, currentInnings='2'
  WHERE matchID='73' 

 

Now the problem is that currentWickets=0, batterStriker=1, batterNonStriker=2, batterOnStrike=1, ballAge=0, currentInningsScore=0 fields DO NOT UPDATE!!  I know this because I look straight at the database after it updates and I have checked each field, each field that was a variable updates fine but those fields that update with an Integer do not update.

 

Any suggestions?  All I have tried so far is to put '' around the integers currentWickets='0', batterStriker='1', batterNonStriker='2', batterOnStrike='1', ballAge='0', currentInningsScore='0' but that doesn't work either.

 

EDIT: I HAVE SOLVED THIS PROBLEM - ANOTHER FUNCTION WAS BEING CALLED (WHICH WASN'T SUPPOSED TO BE) AND CHANGING ALL THE VALUES BACK!

Link to comment
https://forums.phpfreaks.com/topic/191235-fields-not-being-updated/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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