Ok. Within the page I put INSERT and SELECT. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <?php require_once('mysql.php'); /*$query = "INSERT INTO book (ft0, ft1, ft2, ft3, ft4) VALUES ('$FirstName', '$LastName', '$PhoneNumber')";*/ ?> <?php //some stuff up here //check to make sure field has value /*if(empty($_POST['ft0']) { echo 'You must fill in the textarea!'; die(); } $i = 1; mysql_query('INSERT INTO book (ft0) VALUES ("'.mysql_real_escape_string($_REQUEST["ft0".$i]).'")'); */ mysql_select_db("satb", $con); for ($i=1; $i<=30; $i++) { $sql="INSERT INTO book (line) VALUES ('$_POST[line15]')"; } if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con); $con = mysql_connect("","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } // some code $result = mysql_query("SELECT line FROM book"); //$sql2 = "SELECT line FROM book"; echo "<br />" .$result; while($row = mysql_fetch_array($result))//line 61 { echo $row['line']; echo "<br />"; } ?> </body> </html> PHP:
Replace: $result = mysql_query("SELECT line FROM book"); PHP: With: $result = mysql_query("SELECT line FROM book") OR die(mysql_error()); PHP: And tell me what error you get.