Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2012

    Unanswered: Why can't I connect to my database? Noob alert!

    Hello, I'm quite new to databases and have no idea where I have gone wrong. Please help me find out why I can't connect to my database.

    I'm getting an error with Dreamweaver - Dynamicaly-related files cannot be discovered because there is no site definition for this document

    My Site root is located in htdocs.
    the main file I'm trying to run is "dataquery.php" - htdocs/LetsPlays/dataquery.php

    include 'includes/databaseform.php';
    $query = "SELECT * FROM userchanel";
    $result = mysql_query($query);
    while($person = mysql_fetch_array($result));
    echo $person['chanelurl'];

    Dataquery is connected to "databaseform.php" - htdocs/LetsPLays/includes/databaseform.php

    $dbhost = 'localhost';
    $dbuser = 'root';
    $dbpass ='';
    $db = 'mysql_tut';
    $conn = mysql_connect($dbhost,$dbuser,$dbpas);

    So I'm trying to connect to userchanel table through user tbl
    screenshot: Imageshack - usertbl.png

    Files run through wordpress are set up to run on
    Please help me.

    Sorry for the noobishness! I have no idea what I'm missing!
    When I run the html file all I get is a blank page!

  2. #2
    Join Date
    Sep 2009
    San Sebastian, Spain
    You should look more closely at the code being used to open a connection with the database and display any error messages should the function fail in error.

    $conn = mysql_connect($dbhost, $dbuser, $dbpas) or die("ERROR:" . mysql_error());
    mysql_select_db($userchanel) or die("ERROR: " . mysql_error());
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    Follow me on Twitter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts