CK9 Posted September 23, 2009 Share Posted September 23, 2009 Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/ck9/public_html/scheduels/combine.php on line 13 <?php mysql_connect("localhost", user, pass) or doe(mysql_error()); mysql_select_db(database) or die(mysql_error()); $query = "SELECT * FROM monday"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo $row['name']; echo "<br />"; } echo "<form action="mash.php" method="post" target="blank">"; echo "Name 1:"; echo "<input name="name1" type="text" />"; echo " Name 2:"; echo "<input name="quantity" type="text" />"; echo "<input type="submit" />"; echo "</form>"; ?> I'm so far out of practice with PHP--due to a situation with my host and another person causing me to be unable to access my files for so long--that I can't remember how to solve this :/ Quote Link to comment https://forums.phpfreaks.com/topic/175253-solved-error-cant-remember-how-to-resolve-it/ Share on other sites More sharing options...
TeNDoLLA Posted September 23, 2009 Share Posted September 23, 2009 You should escape the double quotes inside the echo's or use single quotes around the echoed string. This way the echoed string won't break up and cause errors. Also one of your die() functions has typo. You have written doe instead of die. Quote Link to comment https://forums.phpfreaks.com/topic/175253-solved-error-cant-remember-how-to-resolve-it/#findComment-923658 Share on other sites More sharing options...
herghost Posted September 23, 2009 Share Posted September 23, 2009 Try This <?php mysql_connect("localhost", user, pass) or die(mysql_error()); mysql_select_db(database) or die(mysql_error()); $query = "SELECT * FROM monday"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo $row['name']; echo "<br />"; } echo "<form action='mash.php' method='post' target='blank'>"; echo "Name 1:"; echo "<input name='name1' type='text' />"; echo " Name 2:"; echo "<input name='quantity' type='text' />"; echo "<input type='submit' />"; echo "</form>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/175253-solved-error-cant-remember-how-to-resolve-it/#findComment-923660 Share on other sites More sharing options...
CK9 Posted September 23, 2009 Author Share Posted September 23, 2009 oops, lol Thanks for pointing that out, I wouldn't have remembered that for the life of me *hug* I can switch 'post' to 'get', right? I'm thinking it would be better to be able to refresh for updated information rather than going back to this page. Quote Link to comment https://forums.phpfreaks.com/topic/175253-solved-error-cant-remember-how-to-resolve-it/#findComment-923665 Share on other sites More sharing options...
nuttycoder Posted September 23, 2009 Share Posted September 23, 2009 yes remember to update any instance to get. Quote Link to comment https://forums.phpfreaks.com/topic/175253-solved-error-cant-remember-how-to-resolve-it/#findComment-923666 Share on other sites More sharing options...
CK9 Posted September 23, 2009 Author Share Posted September 23, 2009 Thanks everyone, just ran the full coding through a test and it works beautifully Quote Link to comment https://forums.phpfreaks.com/topic/175253-solved-error-cant-remember-how-to-resolve-it/#findComment-923674 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.