www.webdeveloper.com
Results 1 to 2 of 2

Thread: Doesn't Work - Why?

  1. #1
    Join Date
    Nov 2007
    Posts
    362

    Doesn't Work - Why?

    Why doesn't the contents of the "title" field get displayed on the screen?

    Code:
    <?php
    $con = mysql_connect("localhost","ODBC","");
    if (!$con)
    {
      die(mysql_error());
    }
    
    mysql_select_db("MP3", $con);
    
    $result = mysql_query("SELECT * FROM books");
    
    
    
      echo $result['title'];
    
    
    
    mysql_close($con);
    ?>

  2. #2
    Join Date
    Mar 2007
    Posts
    151
    $result = mysql_query("SELECT * FROM books");
    $row = mysql_fetch_array($result);
    echo $row['title'];
    "In retrospect it becomes clear that hindsight is definitely overrated!" ~ Alfred E. Neuman

    http://tcallaway.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles