Announcement

Collapse
No announcement yet.

PHP and MySQL Site Design

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    This is Just getting Ridiculous

    OK, so I thought maybe something to do with includes/requires might be the source of my problem. I tried making the simplest little page ever to call up the info. Still to no avail. All the usernames/passwords etc are correct, and all I get is this...

    PHP Code:
    <html><body>
    <?php
    $host
    ="localhost";
    $user="user";
    $pass="pass";
    $db="db";?>
    <?php
    // open database connection
    $connection mysql_connect($host$user$pass) or die ("Unable to connect!");
    // select database
    mysql_select_db($db) or die ("Unable to select database!");
    // generate and execute query
    $query "SELECT content FROM global WHERE id = '1'";
    $result mysql_query($query) or die ("Error in query: $query. " mysql_error());?>
    <?php 
    echo $result;
    ?>
    I've attached an image of what this produces when run.

    Comment


    • #17
      PHP Code:
      <html><body>
      <?
      $host
      ='localhost';
      $user='user';
      $pass='pass';
      $db='db';
      // open database connection
      $connection mysql_connect($host$user$pass) or die ('Unable to connect!');
      // select database
      mysql_select_db($db) or die ('Unable to select database!');
      // generate and execute query
      $query "SELECT content FROM global WHERE id = '1'";
      $result mysql_query($query) or die ("Error in query: $query. " mysql_error());
      echo 
      $result['content'];
      ?>

      Comment


      • #18
        Tried that, substituted in the correct user/pass etc, just gave me back a completely blank page. Can this really be so hard, feel like I'm hitting my head off a brick wall.

        Comment


        • #19
          damn didnt look at it hard enuff..... Do this
          PHP Code:
          <html><body>
          <?
          $host
          ='localhost';
          $user='user';
          $pass='pass';
          $db='db';
          // open database connection
          $connection mysql_connect($host$user$pass) or die ('Unable to connect!');
          // select database
          mysql_select_db($db) or die ('Unable to select database!');
          // generate and execute query
          $query "SELECT content FROM global WHERE id = '1'";
          $result mysql_query($query) or die ("Error in query: $query. " mysql_error());
          $row mysql_fetch_array($result);
          echo 
          $row['content'];
          ?>

          Comment


          • #20
            YOU ARE A CERTIFIABLE FECKIN GENIUS!!! IT WORKS, JUST LIKE THAT!!!!!!!!! WOOOHOOO!!!!

            EDIT: MAN, I COULD KISS YOU!!! THE WHOLE FRICKIN SITE BUILT UP ON THE FLY, ONE CHANGE IN PHPMYADMIN REBUILDS THE ENTIRE SITE, ADMIN CONTROL VIA FORMS ETC... ALL CAUSE OF YOU!!

            Ok, enough with the enthusiasm...
            Last edited by MartynJ; Fri 12 Jul '02, 4:47pm.

            Comment

            Loading...
            Working...
            X