#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Colombo, Western, Sri Lanka
    Posts
    41
    Rep Power
    14
    I cant seem to find anything wrong with the script given below. Instead of displaying the contents of each field in each table-column, it simply displays the id of the product in each table-column. Can someone tell me what's wrong please??

    Here's the script:

    <?php

    (connection to db)....

    $todelete=mysql_query("select * from products where code='$productcode'");

    $todeleterows=mysql_numrows($todelete);

    if ($todeleterows>0) {

    echo " Are you sure you want to delete the following product :";

    echo "<p><table border="1">";

    echo "<tr><td>";

    echo mysql_result($todelete,"code");

    echo "</td><td>";

    echo mysql_result($todelete,"latin_name");

    echo "</td><td>";

    echo mysql_result($todelete,"common_name");

    echo "</td></table>";

    }else{

    echo "Sorry. This product is not exist in the inventory.";

    }

    ?>
    </body>
    </html>
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Colombo, Western, Sri Lanka
    Posts
    41
    Rep Power
    14
    Solved it!!!

    mysql_result($todelete,"0","code");

    This worked. I'm using a fixed number since I know there wont be more than 1 product with the same code.


Similar Threads

  1. Flash in apache - wont work!
    By Fish_12345 in forum Apache Development
    Replies: 2
    Last Post: October 11th, 2004, 01:43 PM
  2. php script won't work inside "cgi-local" directory
    By Volitics in forum PHP Development
    Replies: 5
    Last Post: April 26th, 2004, 10:50 PM
  3. Experienced undergrad senior ... freelance work wanted
    By carrja99 in forum Hire A Programmer
    Replies: 0
    Last Post: January 28th, 2004, 11:32 PM
  4. I'll pay someone $150 to do some PHP work for me!
    By Noah Neiman in forum Hire A Programmer
    Replies: 16
    Last Post: January 23rd, 2004, 03:15 AM
  5. I need some specific php work done for my website
    By Noah Neiman in forum Hire A Programmer
    Replies: 1
    Last Post: January 20th, 2004, 11:31 PM

IMN logo majestic logo threadwatch logo seochat tools logo