rondog Posted August 30, 2007 Share Posted August 30, 2007 ok this was working before I dont know why it isnt anymore. First here is my code <?php session_start(); if($_SESSION['loggedIn'] != 'yes'){ header("Location: mustbelogged.php"); } ?> <!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>Datron World Communications :: FCPA Training</title> <script src="globaliefix.js"></script> <style type="text/css" media="all"> @import url(style.css); </style> <?php $con = mysql_connect("localhost","username","password"); if (!$con) { echo "unable to connect to DB"; echo mysql_error($con); exit(); } $db = mysql_select_db("datron"); if (!$db) { echo "unable to open DB"; echo mysql_error($db); exit(); } $uname = $_SESSION['username']; $date = date("m-d-y") /* THIS BREAKS MY PAGE */ $datequery = "INSERT INTO users timelogged VALUES $date WHERE username = '$uname'"; $rundate = mysql_query($datequery) $logquery = "UPDATE users SET loggedin = 'viewed' WHERE username = '$uname'"; $runlog = mysql_query($logquery); ?> </head> <body> <div id="wrapper"> <div id="wrapbg"> <div id="banner"></div> <div id="content"> <div id="trainingforum" align="center"> <p>Welcome & Introduction</p> <script type="text/javascript">art1();</script> </div> </div> <div id="footer"> <p>Copyright © 2007 Datron World Communications, Inc. All rights reserved.</p> <!--<div id="signout"><a href="#">Sign Out</a></div>--> </div> </div> </div> </body> </html> ok if I comment out my querys on the bottom of my php, my page will load. If I uncomment them nothing loads..is there something wrong with my insert and update statements again?? Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 30, 2007 Share Posted August 30, 2007 Add this to the top so you can see the errors: ini_set('display_errors', 1); error_reporting(E_ALL); Quote Link to comment Share on other sites More sharing options...
rondog Posted August 30, 2007 Author Share Posted August 30, 2007 ok I posted it where my session_start is and I got nothing so I moved that down below my connect script and still got nothing ??? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 30, 2007 Share Posted August 30, 2007 This line: $rundate = mysql_query($datequery) Should have a semi-colon at the end of it: $rundate = mysql_query($datequery); EDIT: Tyhe same applies to this line too: $date = date("m-d-y") Go through you code and make sure you have semi-colons at the end of lines Quote Link to comment Share on other sites More sharing options...
rondog Posted August 30, 2007 Author Share Posted August 30, 2007 oh my..these past few days ive been coding and I keep getting these minor errors! Ok thank you for finding that..I have a question because I know this would help me a lot! on some other servers ive coded on if there is a missing semi-colon or whatever it returns an error..on this current server if there is an error like that it returns nothing..a blank page..how do I turn on those errors?? I do have access to the php ini file. Quote Link to comment Share on other sites More sharing options...
rondog Posted August 30, 2007 Author Share Posted August 30, 2007 nevermind I got it!! thanks! 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.