hI! I do not know what is wrong with this code- because i don't get the results on screen as i wrote in the code: $rt=mysql_query("SELECT name FROM students"); if(!$rt) echo "ERROR: error occured in MySQL query."; // if any error is there that will be printed to the else { echo "connected successfully to query"; while ($row=mysql_fetch_array($rt)) { echo "name: {$row['name'] }". } } mysql_close($mysql_link); ?> Need your help Progfrog Code (markup):
try like this $rt=mysql_query("SELECT name FROM students"); if(!$rt) echo "ERROR: error occured in MySQL query."; // if any error is there that will be printed to the else { echo "connected successfully to query"; while ($row=mysql_fetch_array($rt)) { echo "name: {$row['name'] }"; } } mysql_close($mysql_link); ?>
change these lines and hopefully it ill work $rt=mysql_query("SELECT name FROM students"); => $rt=mysql_query("SELECT `name` FROM students"); echo "name: {$row['name'] }"; => echo "name: {$row[name] }";