Jump to content

Search the Community

Showing results for tags 'last'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I have been struggling for a few days on this one and don't know what to search for to get the answers I'm looking for. I would like to be able to pull up the last entries of individual products in an inventory table. I already have things so the product names are uniform (product column) and that it has a currently updated total. What I want is for my users to be able to go to a page that pulls up only the last entries for each individual product. (not the whole database). The following brings up everything. But I'm looking for a quick page where it only looks for the total (tot) of the most recent entry of EACH unique product. This way products can be added through a dropdown populated by another table. $sql = "SELECT * FROM inventory"; if(!$result = $db->query($sql)){ die('There was an error running the query [' . $db->error . ']'); } echo "<table style='border: 2px;font-family: tahoma;'><caption><b>Entire Database Contents</b></caption><tr><td>ID</td><td>Time Stamp</td><td>Staff</td><td>Client</td><td>Needed</td><td>Product</td><td>Amount</td><td>Totals</td><td style='width: 200px;'>Comments</td></tr>"; while($row = $result->fetch_assoc()){ echo '<td>' . $row['id'] . '</td>'; echo '<td>' . $row['timeStamp'] . '</td>'; echo '<td>' . $row['staff'] . '</td>'; echo '<td>' . $row['client'] . '</td>'; echo '<td>' . $row['dateNeeded'] . '</td>'; echo '<td>' . $row['product'] . '</td>'; echo '<td>' . $row['amt'] . '</td>'; echo '<td>' . $row['tot'] . '</td>'; echo '<td>' . $row['comments'] . '</td></tr>'; } echo "</table>"; thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.