connect_errno) { // The connection failed. What do you want to do? // You could contact yourself (email?), log the error, show a nice page, etc. // You do not want to reveal sensitive information // Let's try this: echo "Sorry, this website is experiencing problems."; // Something you should not do on a public site, but this example will show you // anyways, is print out MySQL error related information -- you might log this echo "Error: Failed to make a MySQL connection, here is why: \n"; echo "Errno: " . $mysqli->connect_errno . "\n"; echo "Error: " . $mysqli->connect_error . "\n"; // You might want to show them something nice, but we will simply exit exit; } ?> query($sql)) { echo "Sorry, the website is experiencing problems."; // Again, do not do this on a public site, but we'll show you how // to get the error information echo "Error: Our query failed to execute and here is why: \n"; echo "Query: " . $sql . "\n"; echo "Errno: " . $mysqli->errno . "\n"; echo "Error: " . $mysqli->error . "\n"; exit; } // Phew, we made it. We know our MySQL connection and query // succeeded, but do we have a result? if ($result->num_rows === 0) { // Oh, no rows! Sometimes that's expected and okay, sometimes // it is not. You decide. In this case, maybe actor_id was too // large? echo "We could not find a match for ID $aid, sorry about that. Please try again."; exit; } // Now, we know only one result will exist in this example so let's // fetch it into an associated array where the array's keys are the // table's column names $contentng = $result->fetch_assoc(); $page_title = $contentng ["LinkName"]; $page_author = $contentng ["PresentLocation"]; //my comment $page_image = $contentng ["Imag"]; $page_body = $contentng ["LinkDescription"]; $page_created = $contentng ["WhenAdded"]; $page_descrip = $contentng ["LinkDescription"]; $page_descrip1 = strip_tags($page_descrip); ?>