Jump to content

LambPatch

New Members
  • Posts

    7
  • Joined

  • Last visited

LambPatch's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks Jacques1. I appreciate the help. Finding good material to learn from has been a real issue. Lots of old mysql code and its hard to find things that have a simple goal in mind. Many try to throw in 'extras' that make it hard to pick out what you're trying to accomplish from the fluff. Any suggestions on good beginner books, websites or whatever? Anyway, thanks again.
  2. I'm not that great at coding but do manage to muddle my way through stuff if I can understand it. I've got a project going where i'd like to have something like the example in w3schools. The link is this one. http://www.w3schools.com/php/php_ajax_database.asp I have been trying to replicate this on my own server but its not working. what I'm seeing is error message. Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in D:\Hosting\8937614\html\vfd\famguy1.php on line 40 I'm seeing on the php file there is a line that goes like this: mysqli_select_db($con,"ajax"); I looked it up but the explanation is very vague, changing databases. Can someone explain what's happening here in why? thanks, Gail
  3. Thanks, I've looked into it and think I have found a tutorial I can follow to some extent. Have a great day.
  4. I was wondering if its possible to have a mysql server send a delayed message. I work for veterinarians and would like to have it send a reminder message in 2 weeks. Any input is welcome. Thanks!
  5. Barand! You did it! I had to add the tot to it but it works now. I didn't even realize it was possible to "make up new stuff" in mysql! very cool. Thanks so much! In the end, it looks like this: SELECT product, tot, MAX(timestamp) as lastsale FROM inventory GROUP BY product ORDER BY lastsale DESC LIMIT 4
  6. Yep, it has a timestamp column, but we sell many more of some items than others. So if I were to tell it to get say the last 4 entries, 3 of those may be one product, 1 entry another product and 2 products wouldn't even come up at all because they're aren't in the last 4. I could probably get it to work by having it look for each individual product by writing code specific to each but it seems like it should be able to do this. look through the product column, find unique products (currently there's only 4 but there will be more) . Product item name comes from a dropdown populated from another table so names are uniform Find the last entry on each of the unique products (timestamp) List the product name and the total from that column. In the end, what would happen is it would bring up the last entry for each product and the total for it so there's a running list of inventory.
  7. 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.