Parse error: syntax error, unexpected ">"

Parse error: syntax error, unexpected ">"

am 23.09.2009 16:18:17 von Haig Davis

--001636283a36e7f34104743f623c
Content-Type: text/plain; charset=ISO-8859-1

Good morning Everyone,

I'm have trouble with a simple HTML Checkbox list. I keep getting *Parse
error*: syntax error, unexpected '>'. I'm sure I'm doing something really
simple and basic wrong I just cannot seem to see what it is, any assistance
is appreciated.

Script:



$sql = "SELECT * FROM melstatus WHERE custID=$custID ORDER BY
aircraftRegistration";

$q = mysql_query($q)
or die ("could not execute query.");

echo "

    \n;

    while($row = mysql_fetch_array($q))
    {
    echo "
  • ".$row['melID']." name="\".$row['melID].\""/input> ";

  • \n";
    }
    echo "


?>


Many Thanks

Haig

--001636283a36e7f34104743f623c--

Re: Parse error: syntax error, unexpected ">"

am 23.09.2009 16:23:07 von Fernando Castillo Aparicio

--0-1856763213-1253715787=:41759
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

You missed a double quote here: echo "

=0A l style=3D'list-style: none'>\n"; =0A___________________________=
_____=0ADe: Haig Davis =0APara: php-general@lists.php.n=
et=0AEnviado: mi=E9rcoles, 23 de septiembre, 2009 16:18:17=0AAsunto: [PHP] =
Parse error: syntax error, unexpected '>' Good morning Everyone, =
I'm have trouble with a simple HTML Checkbox list. I keep getting *Parse=0A=
error*: syntax error, unexpected '>'. I'm sure I'm doing something really=
=0Asimple and basic wrong I just cannot seem to see what it is, any assista=
nce=0Ais appreciated. Script:
p://bw.org/misc/cgi-test/test.cgi"> lstatus WHERE custID=3D$custID ORDER BY=0AaircraftRegistration"; =
$q =3D mysql_query($q)=0A or die ("could not execute query.");=0A=
=0A echo "
=0A
    \n;=
    while($row =3D mysql_fetch_array($q))=0A {=0A echo =
    "
  • ".$row['melID']." ""/input> ";
  • \n";=0A }=0A echo "
> ?>=0A Many Thanks Haig
--0-1856763213-1253715787=:41759--

Re: Parse error: syntax error, unexpected ">"

am 23.09.2009 16:25:22 von Ashley Sheridan

On Wed, 2009-09-23 at 07:18 -0700, Haig Davis wrote:
> echo "

  • ".$row['melID']." > name="\".$row['melID].\""/input> ";

    You're escaping in the wrong places. The \ escapes the character
    following it, so what you are doing here, in line 2, is breaking out of
    the string with a regular " and then printing a " (escaped \") Also, I
    think you need to brush up on your HTML a bit, as



    is not valid HTML.


    Thanks,
    Ash
    http://www.ashleysheridan.co.uk




    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php

  • Re: Parse error: syntax error, unexpected ">"

    am 23.09.2009 16:32:27 von Fernando Castillo Aparicio

    --0-1289159746-1253716347=:45560
    Content-Type: text/plain; charset=iso-8859-1
    Content-Transfer-Encoding: quoted-printable

    Reading again, it's not just one miss. You have to close some strings, esca=
    pe some quotes, etc I think this can be right: $sql =3D "SELECT *=
    FROM melstatus WHERE custID=3D$custID ORDER BY=0AaircraftRegistration";=0A=
    =0A $q =3D mysql_query($q)=0A or die ("could not execute quer=
    y."); echo "

    =0A
      e'>\n"; while($row =3D mysql_fetch_array($q))=0A {=0A =
      echo "
    • ".$row['melID']." 'melID']."\"/> "; echo "
    • \n";=0A }=0A echo " >
    "; =0AI'd recomend you to get a good text editor with sint=
    ax highlighting if you haven't one. It would warn you from most of these mi=
    stakes. And an xhtml issue: to use an empty tag, you use and no=
    t ________________________________=0ADe: Fernand=
    o Castillo Aparicio =0APara: Haig Davis l.com>; php-general@lists.php.net=0AEnviado: mi=E9rcoles, 23 de septiembre,=
    2009 16:23:07=0AAsunto: Re: [PHP] Parse error: syntax error, unexpected '>=
    ' You missed a double quote here: echo "
    =0A =
      \n"; =0A____________________=
      ____________=0ADe: Haig Davis =0APara: php-general@list=
      s.php.net=0AEnviado: mi=E9rcoles, 23 de septiembre, 2009 16:18:17=0AAsunto:=
      [PHP] Parse error: syntax error, unexpected '>' Good morning Everyone=
      , I'm have trouble with a simple HTML Checkbox list. I keep getting *P=
      arse=0Aerror*: syntax error, unexpected '>'. I'm sure I'm doing something r=
      eally=0Asimple and basic wrong I just cannot seem to see what it is, any as=
      sistance=0Ais appreciated. Script:
      =3D"http://bw.org/misc/cgi-test/test.cgi"> FROM melstatus WHERE custID=3D$custID ORDER BY=0AaircraftRegistration";=0A=
      =0A $q =3D mysql_query($q)=0A or die ("could not execute quer=
      y."); echo "
      =0A
        e'>\n; while($row =3D mysql_fetch_array($q))=0A {=0A =
        echo "
      • ".$row['melID']." lID].\""/input> ";
      • \n";=0A }=0A echo "
      eldset> ?>=0A Many Thanks Haig =0A
      --0-1289159746-1253716347=:45560--