Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE)
You have extra single quotes :
$introduction="INSERT INTO Introduction (Title, Description)
VALUES ('$_POST[introtitle]','$_POST[introdescription]')";
syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE)
You have to change your code as below:
echo "<img src='$row[logo]' /><br />";
OR
echo "<img src='".$row[logo]."' /><br />";
Error : ( ! ) Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING)
echo $row['Fullname']." ".$row['studentNo']." ".$row['SubjectName']." ".$row['GPA']." ".$row['CGPA']." ".$row['SCORE']."<br/>"; // Error here
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:/... on line 10
You have syntax errors in your query. You need to have the curley brackets around every $_POST
in your query, and your query should be ... VALUE (....)
change -
$sql= "INSERT INTO inside VALUES{($_POST['name']),($_POST['telephone']),($_POST['comment'])}";
to
$sql= "INSERT INTO inside VALUES ( {$_POST['name']}, {$_POST['telephone']},{$_POST['comment']})";
see
http://dev.mysql.com/doc/refman/5.6/en/insert.html
and
http://php.net/manual/en/language.types.string.php#language.types.string.parsing.complex
also, you should not be inserting user data directly into your database. take a look at
How can I prevent SQL injection in PHP?
PHP syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING
The correct syntax is:
{{ URL::to('user/reset', array($token)) }}
PHP: Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE)
The way in which you were embedding the php tags within the quoted string was causing the issue. You will find it easier to format the code properly IMO! I think the following ought to be ok, the values are now encapsulated in curly braces.
while($row = mysql_fetch_array($query) or die(mysql_error())){
echo '<form>';
while ($row=mysql_fetch_array($query))
{
echo '<div class="boxed" >';
echo "\t".'<tr><th>'.
$row['question']."<br>".
'</th><th>'."<input type='radio' name='optn' value='{$row['A']}'>".$row['A']."<br>".
'</th><th>'."<input type='radio' name='optn' value='{$row['B']}'>".$row['B']."<br>".
'</th><th>'."<input type='radio' name='optn' value='{$row['C']}'>".$row['C']."<br>".
'</th><th>'."<input type='radio' name='optn' value='{$row['D']}'>".$row['D'].'</th>
</tr>';
echo '<input type="submit" name="submit" />';
echo '</div>';
}
echo '</form>';
}
Below is a re-written version which, I think, better illustrates the problems in the code you gave.
while( $row = mysql_fetch_array($query) or die(mysql_error())){
echo '<form>';
while( $row=mysql_fetch_array( $query ) ){
echo "
<div class='boxed'>
<tr>
<th>
{$row['question']}<br>
</th>
<th><input type='radio' name='optn' value='{$row['A']}'>{$row['A']}<br>
</th><th><input type='radio' name='optn' value='{$row['B']}'>{$row['B']}<br>
</th><th><input type='radio' name='optn' value='{$row['C']}'>{$row['C']}<br>
</th><th><input type='radio' name='optn' value='{$row['D']}'>{$row['D']}</th>
</tr>
<input type='submit' name='submit' />
</div>";
}
echo "</form>";
}
There is no table
tag yet you have tr
and th
tags and there is a nested while loop...
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE
This should work:
<select id="cd" name="cd">
<?php
while($row=mysql_fetch_array($cdresult)) {
echo "<option value=".$row['Poblacion']."></option><br/>";
}
mysql_close($link);
?>
</select>
Related Topics
Mysqli - Fetch_Array Error Call to a Member Function Fetch_Array() on a Non-Object MySQLi
Laravel 4.1: How to Paginate Eloquent Eager Relationship
Get Content Within a HTML Tag Using PHP and Replace It After Processing
Pdo: Call to a Member Function Fetch() on a Non-Object
.Htaccess Mod_Rewrite > 500 Internal Server Error
Static Class Initializer in PHP
Laravel 5:Class 'Input' Not Found
How to Block Disposable Email Addresses in Your Website's Registration Form
Install PHP-Mcrypt on Centos 6
Destroy Session on Window Close
How to Use an Object Method as a Callback Function
How to Get Value from Form Without Submitting It
PHP Regex for Validating a Url
Simple Xml Add Namespaced Child
Laravel Password Validation Rule
Laravel Eloquent: How to Get Only Certain Columns from Joined Tables