liamloveslearning Posted April 29, 2010 Share Posted April 29, 2010 Hi everyone, im working on a page which is broken somewhere and I cant figure out where, Im still learning PHP and I am a serious amateru but I thought if I incl. error reporting all atop of the page it should at least tell me it errors? my code is .. <?php require_once('Connections/saucy_connection.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $colname_getimg = "-1"; if (isset($_GET['photo']) { $colname_getimg = $_GET['photo']; } mysql_select_db($database_saucy_connection, $saucy_connection); $query_getimg = sprintf("SELECT id, user_picture, picture_downloads FROM model_pictures WHERE id = %s", GetSQLValueString($colname_getimg, "int")); $getimg = mysql_query($query_getimg, $saucy_connection) or die(mysql_error()); $row_getimg = mysql_fetch_assoc($getimg); $totalRows_getimg = mysql_num_rows($getimg); ?> <!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=UTF-8" /> <title>Untitled Document</title> </head> <body> <p>Hello <?php echo $_GET['user']; ?>, You have bought <?php echo $_GET['photo']; ?><br /><?php echo $row_getimg['user_picture']; ?></p> </body> </html> <?php mysql_free_result($getimg); ?> Quote Link to comment https://forums.phpfreaks.com/topic/200204-no-output/ Share on other sites More sharing options...
aebstract Posted April 29, 2010 Share Posted April 29, 2010 <?php ini_set('display_errors',1); error_reporting(E_ALL); ?> Put that at the very top and see if you get anything. You're getting a white page? Sometimes if you don't get errors you can check your server's error logs and get them that way. Some white screens don't get to show a message as I've encountered. Quote Link to comment https://forums.phpfreaks.com/topic/200204-no-output/#findComment-1050694 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.