I have two separate pages. One page I'm using some UPDATE queries and the second page uses an INSERT query. Neither are updating my database. I can read the database from php, but not update it. Is my syntax correct? I know I can make it more efficiant, but I just want something updating for now.

include ("teamheader.php");
$weeksubmit = $_POST['weeksubmit'];
$awaysubmit = $_POST['awaywinssubmit'];
$homesubmit = $_POST['homewinssubmit'];
$awayteamsubmit = $_POST['awaypost'];
$today = date("Y/m/d");
$firstname = $_SESSION['SESS_FIRST_NAME'];
$lastname = $_SESSION['SESS_LAST_NAME'];

mysql_query("UPDATE OCSchedule SET AwayWins='$awaysubmit' WHERE Week='$weeksubmit' AND AwayTeam='$awayteamsubmit'");
mysql_query("UPDATE OCSchedule SET HomeWins='$homesubmit' WHERE Week='$weeksubmit' AND AwayTeam='$awayteamsubmit'");
mysql_query("UPDATE OCSchedule SET Updated='$today' WHERE Week='$weeksubmit' AND AwayTeam='$awayteamsubmit'");
mysql_query("UPDATE OCSchedule SET UpdatedBy='$firstname' WHERE Week='$weeksubmit' AND AwayTeam='$awayteamsubmit'");

Here's an insert query.

if ($TeamBPlayers[$insertcounter] != 0)
{
	  mysql_query("INSERT INTO OCNews (Story, PlayerID, TeamID, NewTeamID, TradeFlag, NewsBox, EOYFlag)
	  VALUES ($insertstory, $TeamBPlayers[$insertcounter], $TeamB, $TeamA, 1, $Comments, $TeamBEOY[$insertcounter])");
}

Thoughts?

Nevermind, I found the mistakes.

You should mark it as solved even though you found it yourself.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.