2013-05-17 42 views
0

我不確定將CSS應用到我已生成的表的位置。我越來越如何將CSS應用到生成到另一個窗口的表中?

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/08/10674308/html/venuesearch.php on line 133

我行133是這樣的

$resultString .= "<div id=".table-2" class=\\\"results\\\">There are " . $result->num_rows . " results for $city, $state:<br /><br /><table>"; 

這裏是我與

<?php 

    include "dbc.php"; 

    $query = <<<EOF 
SELECT * FROM 
    venueprofile 
WHERE 
    city= '$city' 
    AND 
    st= '$state' 
    AND 
    capacity 
    BETWEEN 
     $capacity1 
     AND 
     $capacity2; 
EOF; 

if ($result = mysqli_query($dbc, $query)){ 
    $resultString = "<html>"; 
    $resultString .= "<head><link href=\\\"default.css\\\" rel=\\\"stylesheet\\\"  `enter code here`type=\\\"text/css\\\" media=\\\"all\\\" /></head><body>"; 

    $resultString .= "<div id=".table-2" class=\\\"results\\\">There are " . $result-`enter code here`>num_rows . " results for $city, $state:<br /><br /><table>"; 

    $resultString .= " <tr><thead><th></th>"; 
    $resultString .= "  <th>Venue Name</th>"; 
    $resultString .= "  <th>Capacity</th>"; 
    $resultString .= "  <th>City</th>"; 
    $resultString .= "  <th>State</th>"; 
    $resultString .= "  <th>Telephone</th>"; 
    $resultString .= "  <th>Contact</th>"; 
    $resultString .= "  <th>Email</th>";  
    $resultString .= " </thead></tr>"; 
    $rowCount = 0; 
    while ($row =mysqli_fetch_assoc($result)) 
    { 
     $rowCount++; 
     $resultString .= "<tbody><tr>"; 
     $resultString .= "<td>$rowCount</td>"; 
     $resultString .= "<td>" . $row['VenueName'] . "</td>"; 
     $resultString .= "<td>" . $row['capacity'] . "</td>"; 
     $resultString .= "<td>" . $row['city'] . "</td>"; 
     $resultString .= "<td>" . $row['st'] . "</td>"; 
     $resultString .= "<td>" . $row['tele'] . "</td>"; 
     $resultString .= "<td>" . $row['contact'] . "</td>"; 
     $resultString .= "<td>" . $row['EmailAddress'] . "</td>";  
     $resultString .= "</tr></tbody>"; 
    } 
    $resultString .= "</table></div></body></html>"; 
?> 
<script type="text/javascript"> 
    newWindow("resultsWindow"+(resultsWindows.length - 1),"<?php echo $resultString; ?`enter code here`>",400,400); 
</script> 
<?php 

外部CSS工作代碼

#table-2 { 
    border: 1px solid #e3e3e3; 
    background-color: #f2f2f2; 
     width: 100%; 
    border-radius: 6px; 
    -webkit-border-radius: 6px; 
    -moz-border-radius: 6px; 
} 
#table-2 td, #table-2 th { 
    padding: 5px; 
    color: #333; 
} 


#table-2 thead { 
    font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; 
    padding: .2em 0 .2em .5em; 
    text-align: left; 
    color: #4B4B4B; 
    background-color: #C8C8C8; 
    background-image: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#e3e3e3), color-stop(.6,#B3B3B3)); 
    background-image: -moz-linear-gradient(top, #D6D6D6, #B0B0B0, #B3B3B3 90%); 
    border-bottom: solid 1px #999; 
} 
#table-2 th { 
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 
    font-size: 17px; 
    line-height: 20px; 
    font-style: normal; 
    font-weight: normal; 
    text-align: left; 
    text-shadow: white 1px 1px 1px; 
} 
#table-2 td { 
    line-height: 20px; 
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 
    font-size: 14px; 
    border-bottom: 1px solid #fff; 
    border-top: 1px solid #fff; 
} 
#table-2 td:hover { 
    background-color: #fff; 
} 
+0

正確標識了CSS的路徑嗎? – Magnum

回答

1

你行確已一個錯誤,改變這個:

$resultString .= "<div id=".table-2" class=\\\"results\\\">There are " . $result->num_rows . " results for $city, $state:<br /><br /><table>"; 

這樣:

$resultString .= "<div id='table-2' class='results'>There are " . $result->num_rows . " results for $city, $state:<br /><br /><table>"; 

的問題是用你的方式串聯table-2,因爲你使用的.連接符,然後沒有使用它的其餘部分來連接它串。此外,你只是想連接table-2作爲一個嚴格(因爲這是你的CSS中定義的id),而不是作爲變量(這將是$table-2反正)。

這樣就導致了一堆錯誤。

此外,不知道爲什麼你做了所有的轉義,而你只需要一個反斜槓或只使用雙引號內的單引號。

+0

哎呀,現在我得到以下錯誤:解析錯誤:語法錯誤,意想不到的T_CLASS在/ home /內容08/10674308/html/venuesearch.php行133幫助! –

+0

確實在我的答案中有一個語法錯誤。我編輯它,現在應該沒問題。 – Sunyatasattva

+0

似乎工作。現在我只需要調整報告的外觀就可以了。非常感謝你的幫助。我對這件事感到非常愚蠢。每天,我學習10件新事物。現在我的城市到城市谷歌waypoints問題。迄今爲止,這是一個艱難的過程。 –

相關問題