I'm new to PHP and i'm just trying to get familiar with making database connections etc...

Here is my code:

<?

$connection = mysql_connect(localhost, root);
$database_select = mysql_select_db(mndb);
$query = "select addr from channels";
$result = mysql_query($query);

echo $result;

?>

when i browse to this page i get the following message:

Resource id #2

How do i go about displaying the data i'm querying from the sql database? do i need to put it in an array first?

thanks!

    Hi, i am new to this stuff too, but there is plenty of help in the tutorials sections on php sites. I started by looking at the tutorials at www.webmonkey.com , there is heaps of information out there its just a case of reading a lot. While this doesnt immediately answer your question, i'm sure that u will find the answer by browsing a few tutorials.

    Jeff

      <?

      $connection = mysql_connect(localhost, root);
      $database_select = mysql_select_db(mndb);
      $query = "select addr from channels";
      $result = mysql_query($query);
      while($myrow = mysql_fetch_array($result)) {
      echo $myrow["addr"]."<BR>";
      }
      ?>

        Write a Reply...