i'm a newbie to php still. I'm using phpmyadmin as my database. I have a table called 'lessonno' and a column named 'lesson' in it. I tried using this code to retrieve out the number inside 'lesson'. But it's not printing out anything. Can someone help?
<?php
$server = 'localhost';
$username = '';
$password = '';
$database = 'project';
mysql_connect($server,$username,$password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
$sql = "SELECT 'lesson' FROM 'lessonno'";
$lesson = $_POST['lesson'];
$result = mysql_query($sql);
?>
<?php
for($i = 1; $i <= $lesson; $i++) {
echo "<div>
<a href=\"k1levelX.php?lesson=".$i."\"><span>Lesson ".$i."</span></a>
</div>
<br>";
}
?>
die(mysql_error())like$result = mysql_query($sql) or die(mysql_error());and see what is the error comes$i, which is loop index!! There isn't any use of$resulthere, then how will you get it??