Jump to content

Alex-Grim

Members
  • Posts

    58
  • Joined

  • Last visited

    Never

Everything posted by Alex-Grim

  1. Here's my code in the first file: <?php $br = "<br/><br/>"; $e = "<h1>ErRoR</h1>"; $myfile = "/includes/classes/MySql.php"; readfile($myfile) OR die("<h1>ErRoR! Content not available!</h1>"); include_once $myfile or die($e); echo "Page Loaded, and MySql.php included. $br"; ?> dfffffffffggsdfgsdfgsdfg And the result in the first error message, but i'm sure the path is right...
  2. I am trying to write my first OOP script, and i know that it's messed up, but it's not giving me any errors, or any output. I have turned on the error_reporting to E_STRICT in my php.ini file and restarted apache, but it has made no difference...
  3. You can't find very comprehensive knowledge online. I'm in the same boat. We're probably going to have to hit up ol' Barnes and Nobel...
  4. 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
  5. I was wondering, since there is a procedural way, and an OOP way, and since I've just started and haven't learned either way yet, can someone point me in the direction of some good OOP starter tutorials, so i get off on the right foot. Thanx
  6. 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/>"; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.