Hello,
i am new to php and from this project i have started my php learning so first of sorry if my question is simple to ask but its difficult for me to understand the error and i want to learn php so i really need from all php expert available here.
so i am getting error in generating news or latest post… here is my code
[php]<?
include(“includes/connect.php”);
$select_posts = “select * from posts order by rand() LIMIT 0,2”;
$run_posts = mysql_query($select_post);
while($row=mysql_fetch_array($run_post)){
$title = $row [‘post_title’];
$date = $row [‘post_date’];
$author = $row [‘post_author’];
$image = $row [‘post_image’];
$content = substr($row [‘post_content’],0,200);+
}
?>
<?php echo $title; ?>
[/php]Following i am getting in my news page :
Notice: Undefined variable: title in G:\wamp\www\rect\includes\news_data.php on line 16
First write down what you want to achieve, then break it up into smaller parts and implement them one by one. If you get stuck somewhere, or get errors you don’t understand, come back and we’ll help you out!