Jump to content

[SOLVED] error, can't remember how to resolve it


CK9

Recommended Posts

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 :/

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.

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>";
?>

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.

Archived

This topic is now archived and is closed to further replies.

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