Alex-Grim Posted December 9, 2007 Share Posted December 9, 2007 Well, this was going fine until i changed the $sql from a select statement to an insert statement. Now i get a blank page, and no errors. As you can tell, i'm new (straight from .Net). Here's my code: <?php error_reporting(E_ALL); $host="localhost"; $user="webuser"; $pwd="666"; $dbname="AlexGrim"; $sql="insert into Contents ('pagename','pagetitle','pageprev','pagenext','pagedate','pagecontent')values($_POST['pagename'],$_POST['pagetitle'],$_POST['pageprev'],$_POST['pagenext'],'',$_POST['pagecontent'])"; include_once('sql.php'); $sql2="select * from Content"; include_once('sql2.php'); ?> And here's the included file: <?php echo "<br/><br/>Beginning of sql include<br/><br/>"; if (!$link = mysql_connect($host, $user, $pwd)) { echo 'Could not connect to mysql' . mysql_error(); exit; } if (!mysql_select_db($dbname, $link)) { echo 'Could not select database' . mysql_error(); exit; } $result = mysql_query($sql, $link); if (!$result) { echo "DB Error, could not query the database\n"; echo 'MySQL Error: ' . mysql_error(); exit; } echo "<br/><br/>End of sql include<br/><br/>"; ?> Quote Link to comment Share on other sites More sharing options...
revraz Posted December 9, 2007 Share Posted December 9, 2007 Is your table name Content or Contents? Quote Link to comment Share on other sites More sharing options...
Alex-Grim Posted December 9, 2007 Author Share Posted December 9, 2007 Yeah, i seen that after i posted this, but that's not the problem, it get's stopped before the second query, and besides, i have it commented out for now: <?php error_reporting(E_ALL); $host="localhost"; $user="webuser"; $pwd="666"; $dbname="AlexGrim"; $sql="select * from Contents"; //insert into Contents ('pagename','pagetitle','pageprev','pagenext','pagedate','pagecontent')values($_POST['pagename'],$_POST['pagetitle'],$_POST['pageprev'],$_POST['pagenext'],'',$_POST['pagecontent'])"; include_once('sql.php'); //$sql2="select * from Contents"; //include_once('sql2.php'); ?> Thanx Quote Link to comment Share on other sites More sharing options...
revraz Posted December 9, 2007 Share Posted December 9, 2007 So are you saying you dont see the two echos in the included file? Because your code isn't doing anything to generate any output. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 9, 2007 Share Posted December 9, 2007 Add the following line to make sure error display is on - ini_set ("display_errors", "1"); Also, if there is a fatal parse error, you will get a blank page. Check your web server log for errors. Quote Link to comment 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.