Jump to content

Unable to see the content


divinedesigns1

Recommended Posts

ok im having a problem with getting the information being pulled to display on the edit page, i keep checking for any problems (not getting any errors) and also im checking for misspelled words and unclose tags but nothing so far, everything seems to be close and spelled correctly this is the code

<?phpinclude_once("scripts/config.php");// Has album been updated?if($_POST['edit']){ if(empty($_POST['album_name']) || empty($_POST['album_desc'])){  $msg = "Please complete all required fields!<br /><a href='new_album.php'>Back</a>";  displayPage($msg, "Error Updating Album!");  die(); } db_connect(); // Insert update record into database $sql = "UPDATE album SET album_name = '" . addslashes($_POST['album_name']) . "', album_desc = '" . addslashes($_POST['album_desc']) . "' WHERE album_id = '" . addslashes($_POST['album_id']); $result = @mysql_query($sql) or die("Error inserting record: " . mysql_error()); if($result){  $msg = "Album updated successfully! <br/><a href='index.php'>Admin Menu</a>";  displayPage($msg, "Album Updated Successfully!");  die(); }}else if(!$_POST['edit'] && !empty($_GET['album_id'])){ db_connect(); // Retrieve album data $sql = "SELECT album_id, album_name, album_desc FROM album WHERE album_id = " . addslashes($_GET['album_id']); $result = @mysql_query($sql) or die("Error retrieve data: " . mysql_error()); while($row = mysql_fetch_array($result)){  // Display edit page  $msg .= "<form action=\"edit_albums.php\" method=\"post\">\n";  $msg .= "<table width=\"60%\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\">\n";  $msg .= "<tr>\n<td>Album Name:</td>\n<td><input name=\"album_name\" type=\"text\" id=\"album_name\" size=\"40\" value\"" . $row['album_name'] . "\"></td>\n</tr>\n";  $msg .= "<tr>\n<td>Album Description: </td>\n<td><textarea name=\"album_desc\" cols=\"30\" row=\"4\" id=\"album_desc\">" . $row['album_desc'] . "</textarea></td>\n</tr>\n";  $msg .= "<tr>\n<td><input type=\"hidden\" name=\"edit\" value=\"1\"><input type=\"hidden\" name=\"album_id\" value=\"" . $_GET['album_id'] . "\"></td>\n";  $msg .= "<td><input name=\"submit\" type=\"submit\" id=\"submit\" value=\"Continue\">";  $msg .= "<a href=\"del_albums.php?album_id=" . addslashes($_GET['album_id']) . "\">Delete</a>";  $msg .= "</td>\n</tr>\n</table>\n</form>";  $album_name = $row['album_name']; } displayPage($msg, " Editing Album " . $album_name . ": "); // Display Album Summaies}elseif(!$_GET['album_id']){ db_connect(); // Retrieve all album information $sql = "SELECT album_id, album_name FROM album"; $result = @mysql_query($sql) or die("Error retrieving records: " . mysql_error()); $i = 0; while($row = mysql_fetch_array($result)){  if(($i % 2) == 0 && ($i = 0)){   $msg .= ("</tr>\n<tr>");  }  $msg .= ("<td>" . ($i + 1) . "<a href='edit_albums.php?album_id=" . $row['album_id'] . "'>" . $row['album_name'] . "</td>\n");  $i++; } displayPage($msg, " Edit Albums ", flase);}?>

what is suppose to do is, pull the information by its id, name and description but nothing is being displayed, but its showing

Link to comment
Share on other sites

remove the @ error supressor oparator. and make sure display error enabled for all type of errors.

Link to comment
Share on other sites

what do you mean

make sure display error enabled for all type of errors.
Link to comment
Share on other sites

set 'display_error' directive to 'true'and set error_reporting to 'E_ALL|E_STRICT' either you can set it with ini_set() http://php.net/ini_set or editing your core php.ini file and restarting your server. (recomened if it is your development server)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...