Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP/Mysql - transaction/sale tracking
    primarykey
    data
    text
    <p>First time asking a question on here. If I need to clarify anything please just let me know. I'm new to php/mysql and have been trying to create a tracking system. Here's what I have and what I'm interested in doing.</p> <p>Currently I have <code>mysql table</code> with the following transaction tracking data in it that is parsed from log-files. Transactions expire after 7 days and the status goes from active to expired.</p> <pre><code>transactionid | sendingusername | receivingusername | money | itemamt | status </code></pre> <p>What I'd like is to be able to for someone to click a button <code>looking for buyer</code> or <code>looking for seller</code> and have a query run through all the data above only displaying a user if they have available capacity for the transaction.</p> <p>I have an additional table of users:</p> <pre><code>username | userid | maxcapacity | buyerorseller </code></pre> <p>The person would be a buyer or seller (boolean toggle). If the person is a buyer and and they search for seller, I want it to return a list of sellers who open capacity. The capacity would need to be determined from the maxcapacity column, then referenced against the first table to see if they've filled their capacity.</p> <p>Example:</p> <p>John is in the first table logged as having 4 transactions and has a max capacity of 5 transactions. John is in the second table listed as a seller.</p> <p>Jane clicks the "looking for seller" button and some sort of query runs. Since John only has 4 transactions in the log, and his maxcapacity from table2 is 5, how would I select him to display?</p> <p>Sorry it's late and the energy drinks aren't working anymore. If I need to clarify more just ask, hopefully someone can point me in the right direction.</p> <p>Edit: One caveat to add, in the above example, John may be listed under either <code>senderusername</code> or <code>receiverusername</code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload