Results 1 to 2 of 2

Thread: resource id

  1. #1
    Join Date
    Mar 2006
    Posts
    2

    Unanswered: resource id

    guys

    I am working with a MySQL database and am writing simple queries to extract data from it. However, when I print out the results of the queries all I am getting are the following values

    <?php

    mysql_connect("localhost","adminuser","adminpass") or die ("Could not connect: " . mysql_error());

    mysql_select_db("test") or die ( mysql_error());

    $result = mysql_query("SELECT employee_name FROM employee WHERE employee_salary =$"sal");

    echo $result

    ?>


    Anna_parker

  2. #2
    Join Date
    Apr 2005
    Location
    Baltimore, MD
    Posts
    297
    http://us3.php.net/manual/en/function.mysql-query.php



    PHP Code:

    $result 
    mysql_query("SELECT employee_name FROM employee WHERE employee_salary=$sal");

    while (
    $row mysql_fetch_assoc($result)) {
       echo 
    $row['fieldname1'];
       echo 
    $row['fieldname2'];
       
    //etc.


Posting Permissions

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