Parse error: syntax error, unexpected T_ECHO

后端 未结 2 1490
-上瘾入骨i
-上瘾入骨i 2021-01-24 19:32

I\'ve been working on something for the past few days but this one bit of code perpetually throws an unexpected T_ECHO. My friends can\'t seem to find anything wrong with it an

2条回答
  •  -上瘾入骨i
    2021-01-24 20:12

    Try this...

    I think it may have been falling over because once you've parsed the categories resultset, for the first site, it comes up with nothing the next time you call mysql_fetch_array. So, doing this upfront and popping the results into a variable fixes that.

    I've added "\t" and "\n" to the strings to make the html format prettily in view source.

        $result = mysql_query("select * from tmp_sites");
    $categories = mysql_query("select * from tmp_cats");
    $select_options = "";
    while ($roar = mysql_fetch_array($categories, MYSQL_ASSOC)):
                      $select_options .= "\t\t\n";
                    endwhile;
    echo "";
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)):
                echo "\t\n";
                  echo "\t\t\n";
                  echo "\t\t\n";
                  echo "\t\t\n";
                echo "\t\n";
              endwhile;
    echo "
    ". $row["site_description"] ."". $row["url"] ."
    "

提交回复
热议问题