PHP දන්න අයගෙන් උදව්වක් ඕනේ
මේ code එකේ " ParseError: syntax error, unexpected \'$sql\' (T_VARIABLE) " error එක එනවා ප්රශ්නේ මොකක්ද?
$conn = new mysqli(localhost, motivesweb, motivesweb, motivesweb);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT destination FROM phpfox_photos";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo $row["destination"]. "<br>";
}
} else {
echo "0 results";
}
$conn->close();
මේ code එකේ " ParseError: syntax error, unexpected \'$sql\' (T_VARIABLE) " error එක එනවා ප්රශ්නේ මොකක්ද?
$conn = new mysqli(localhost, motivesweb, motivesweb, motivesweb);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT destination FROM phpfox_photos";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo $row["destination"]. "<br>";
}
} else {
echo "0 results";
}
$conn->close();

