onthespot Posted August 17, 2009 Share Posted August 17, 2009 $result = mysql_query("SELECT team FROM ."$_GET['game']_teams".") or die(mysql_error()); How do I get that to work? thankyou, im getting a parse error atm! Quote Link to comment https://forums.phpfreaks.com/topic/170690-simple-error/ Share on other sites More sharing options...
papaface Posted August 17, 2009 Share Posted August 17, 2009 $result = mysql_query("SELECT `team` FROM `".$_GET['game']."_teams"`) or die(mysql_error()); Not a very good way of doing the query though if you ask me. Quote Link to comment https://forums.phpfreaks.com/topic/170690-simple-error/#findComment-900246 Share on other sites More sharing options...
onthespot Posted August 17, 2009 Author Share Posted August 17, 2009 Thats giving me a parse error dude? Quote Link to comment https://forums.phpfreaks.com/topic/170690-simple-error/#findComment-900251 Share on other sites More sharing options...
AviNahum Posted August 17, 2009 Share Posted August 17, 2009 $result = mysql_query("SELECT team FROM ".$_GET['game']."_teams") or die(mysql_error()); now it's should work Quote Link to comment https://forums.phpfreaks.com/topic/170690-simple-error/#findComment-900254 Share on other sites More sharing options...
onthespot Posted August 17, 2009 Author Share Posted August 17, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/170690-simple-error/#findComment-900262 Share on other sites More sharing options...
AviNahum Posted August 19, 2009 Share Posted August 19, 2009 you still need help? or u solved the problem? Quote Link to comment https://forums.phpfreaks.com/topic/170690-simple-error/#findComment-901459 Share on other sites More sharing options...
mikesta707 Posted August 19, 2009 Share Posted August 19, 2009 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'"; Quote Link to comment https://forums.phpfreaks.com/topic/170690-simple-error/#findComment-901469 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.