gple Posted February 16, 2008 Share Posted February 16, 2008 <?php if (mysql_query("insert into test values (' ', '$day', '$date', '$location', '$time', '$division', '$team1',' ','$team2,' ','$comments')")) {echo "Success";} else {echo "NO";} ?> I keep getting NO. All the variables are correct. Link to comment https://forums.phpfreaks.com/topic/91401-whats-wrong-with-this-codew/ Share on other sites More sharing options...
wildteen88 Posted February 16, 2008 Share Posted February 16, 2008 Change your code to: mysql_query("insert into test values (' ', '$day', '$date', '$location', '$time', '$division', '$team1',' ','$team2,' ','$comments') or die('Query error: ' . mysql_error()); echo 'Success'; Link to comment https://forums.phpfreaks.com/topic/91401-whats-wrong-with-this-codew/#findComment-468353 Share on other sites More sharing options...
AnnieKay Posted February 16, 2008 Share Posted February 16, 2008 I'm fairly new to all this but could it be also that you don't have an apostrophe after your $team2 variable? The next apostrophe comes after the comma so it throws things out of whack, but maybe your original code has it... good luck! Link to comment https://forums.phpfreaks.com/topic/91401-whats-wrong-with-this-codew/#findComment-468359 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.