zamp0e Posted May 27, 2009 Share Posted May 27, 2009 Hai there, I've just started learning about PHP and I've been spending some time trying to make a vote thing that will display the results. So far I've come up with everything but the actual Updating the database when someone votes. This is the error I'm receiving Parse error: parse error in ************ on line 123 <?php } else { if (is_array($_POST['design'])) { echo 'You selected: <br />'; foreach ($_POST['design'] as $a) { echo "<i>$a</i><br />"; } if($a==Stilig) { UPDATE roster SET antal='1' WHERE id='1' } <--- LINE 123! } else { echo 'Nothing selected'; } } ?> Any help would be appreciated, thanks in advance. Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted May 27, 2009 Share Posted May 27, 2009 did you include this in a SQL command? usually this is how you would do an update: mysql_query("UPDATE roster SET antal='1' WHERE id='1'")or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
zamp0e Posted May 27, 2009 Author Share Posted May 27, 2009 Thanks alot As I said I'm very new to this and everywhere Ive read the Update syntax were written like this: UPDATE Persons SET Address='Nissestien 67', City='Sandnes' WHERE LastName='Tjessem' AND FirstName='Jakob' Again, thanks for the help, it worked perfectly. Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted May 27, 2009 Share Posted May 27, 2009 Cool! No problem bud! This is a REALLY awesome forum for learning PHP! Quote Link to comment 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.