Professional Web Applications Themes

P error: syntax error, unexpected T_STRING - Macromedia Dynamic HTML

I have worked with single table up to now but am now trying to select data from multiple tables The recordset tests fine but when I F12 the page to view it live I get this message P error: syntax error, unexpected T_STRING in C:\htdocs\lmv\deals.php on line 13 Line 13 is pointing at the recordset data that tested ok The line shows the following: $query_getLMSpecials = "SELECT resorts.resort_name, resorts.country, resorts.city, resorts.`state`, resorts.page_url, units.id, units.unit_type, units.max_occ, units.check_in, units.sell_price FROM resorts, units WHERE resorts.country = "USA" AND units.sell_price <= 550 AND resorts.id = units.resorts_id ORDER BY resorts.country, resorts.`state`, resorts.city, resorts.resort_name, units.check_in"; Can ...

Sponsored Links
  1. #1

    Default P error: syntax error, unexpected T_STRING

    I have worked with single table up to now but am now trying to select data from
    multiple tables
    The recordset tests fine but when I F12 the page to view it live I get this
    message
    P error: syntax error, unexpected T_STRING in C:\htdocs\lmv\deals.php on
    line 13
    Line 13 is pointing at the recordset data that tested ok
    The line shows the following:
    $query_getLMSpecials = "SELECT resorts.resort_name, resorts.country,
    resorts.city, resorts.`state`, resorts.page_url, units.id, units.unit_type,
    units.max_occ, units.check_in, units.sell_price FROM resorts, units WHERE
    resorts.country = "USA" AND units.sell_price <= 550 AND resorts.id =
    units.resorts_id ORDER BY resorts.country, resorts.`state`, resorts.city,
    resorts.resort_name, units.check_in";
    Can anyone see what the problem is or is the error something else entirely.
    Thanks, Al:sad;

    Sponsored Links
    AlNewUser Guest

  2. #2

    Default Re: P error: syntax error, unexpected T_STRING

    try changing the double quotes here to single quotes:

    = "USA"

    = 'USA'

    --
    Ken Ford
    Adobe Community Expert - Dreamweaver
    Fordwebs, LLC
    http://www.fordwebs.com


    "AlNewUser" <com> wrote in message news:fvg4nd$7p2$macromedia.com... 
    Ken Guest

  3. #3

    Default Re: P error: syntax error, unexpected T_STRING

    ..oO(AlNewUser)
     

    You are assigning a string value to a variable using double quotes. This
    means you can't use unescaped double quotes inside of the string itself
    like in "USA". You either have to escape them or, as in this case and to
    make it a valid SQL query, replace them with single quotes.

    See if this works (reformatted for legibility):

    $query_getLMSpecials = "
    SELECT
    resorts.resort_name,
    resorts.country,
    resorts.city,
    resorts.state,
    resorts.page_url,
    units.id,
    units.unit_type,
    units.max_occ,
    units.check_in,
    units.sell_price
    FROM resorts, units
    WHERE resorts.country = 'USA'
    AND units.sell_price <= 550
    AND resorts.id = units.resorts_id
    ORDER BY
    resorts.country,
    resorts.state,
    resorts.city,
    resorts.resort_name,
    units.check_in";

    Micha
    Michael Guest

  4. #4

    Default Re: P error: syntax error, unexpected T_STRING

    Worked like a charm. Thanks, Al
    AlNewUser Guest

Similar Threads

  1. Unexpected T_STRING error in tutorial
    By gareth in forum Dreamweaver AppDev
    Replies: 5
    Last Post: August 1st, 09:18 PM
  2. P error: p error, unexpected T_STRING
    By Chris in forum PHP Development
    Replies: 4
    Last Post: April 5th, 12:53 AM
  3. PHP P error: p error, unexpected t_string
    By subsidence in forum Dreamweaver AppDev
    Replies: 0
    Last Post: April 2nd, 09:58 PM
  4. #25256 [Bgs->Opn]: P error: p error, unexpected $ in ... on line 642
    By a dot schat at streamedge dot com in forum PHP Development
    Replies: 0
    Last Post: August 26th, 08:26 PM
  5. p error, unexpected T_STRING
    By Kurt Milligan in forum PHP Development
    Replies: 0
    Last Post: July 11th, 01:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139