Hi everyone,
I am tring to learn php by making a website for my own self. I am very new to php and hence i am facing a lot of problems. Mostly i m using code by getting the pregenerated code of phpmyadmin
The following code runs perfect and shows the data by date
<?php
include 'db_config.php';
include 'opendb.php';
$sql = 'SELECT * FROM `table` ORDER BY `table` . `date_added` DESC';
$query = mysql_query($sql, $conn);
for ($i = 1; $i <= 3; $i++) {
if ($row = mysql_fetch_array($query)) {
echo "<tr>";
echo "<td>".$row['id']."</td>";
echo "<td>".$row['file_path']."</td><br>";
echo "</tr>";
}
}
?>
I made few changes to view all the data where the radio field is Video then i get error. I made the changing in only one line as follows
<?php
include 'db_config.php';
include 'opendb.php';
$sql = 'SELECT `radio` FROM `table` WHERE radio = \ 'Video\' LIMIT 0, 30 ';
$query = mysql_query($sql, $conn);
for ($i = 1; $i <= 3; $i++) {
if ($row = mysql_fetch_array($query)) {
echo "<tr>";
echo "<td>".$row['id']."</td>";
echo "<td>".$row['file_path']."</td><br>";
echo "</tr>";
}
}
?>
I get this error "Parse error: parse error, unexpected T_STRING in C:\Program Files\EasyPHP 2.0b1\www\dd\read.php on line 4"
I searched for many other tutorials on using where clause, i implemented them but none of them helped me.
Please help me asap, it would be very helpful for me.
Thanks