Jump to content

simple error


onthespot

Recommended Posts

yeah it did, i fixed it and then realised u had too, thanks though.

got another error, and i cannot work this out!

 

$query3="UPDATE `fixtures` SET `home_user` = '$newuser', `home_team` = '$newteam', WHERE `home_user` = '$olduser' AND `comp` = '$comp'";
$query4="UPDATE `fixtures` SET `away_user` = '$newuser',`away_team` = '$newteam', WHERE `away_user` = '$olduser' AND `comp` = '$comp'";
$query5="UPDATE `submittedresults` SET `home_user` = '$newuser',`home_team` = '$newteam',WHERE `home_user` = '$olduser' AND `comp` = '$comp'";
$query6="UPDATE `submittedresults` SET `away_user` = '$newuser',`away_team` = '$newteam', WHERE `away_user` = '$olduser' AND `comp` = '$comp'";

 

Can anyone see any errors with the WHERE and AND clauses. I am getting errors on those with sql error! thnaks

Link to comment
Share on other sites

delete the comma between the last set and the where clause. it should look like

 

$query3="UPDATE `fixtures` SET `home_user` = '$newuser', `home_team` = '$newteam' WHERE `home_user` = '$olduser' AND `comp` = '$comp'";
$query4="UPDATE `fixtures` SET `away_user` = '$newuser',`away_team` = '$newteam' WHERE `away_user` = '$olduser' AND `comp` = '$comp'";
$query5="UPDATE `submittedresults` SET `home_user` = '$newuser',`home_team` = '$newteam' WHERE `home_user` = '$olduser' AND `comp` = '$comp'";
$query6="UPDATE `submittedresults` SET `away_user` = '$newuser',`away_team` = '$newteam' WHERE `away_user` = '$olduser' AND `comp` = '$comp'";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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