Mysql problem

NamecheapNamecheap
Watch

Coreycyberdesig

Established Member
Impact
0
need mysql help

Hello I am writeing a forum and for soem reason my mind has taken a dump and i cant figure out the query

I have a signle table that has the following cols
thread_type_id thread_name poster post Date_posted thread_order thread_id
and a key

I need to figure out based on the thread type id
how many posts there has been for that thread type id minus the ones that are marked first
How mnay are marked first
and when the last post was made for that thread type id

Could anyone help me out with this
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains — AI StorefrontUnstoppable Domains — AI Storefront
Sorry, I do not understand what you are trying to say...
 
0
•••
better off giving us the proper layout of the tables as well as an exact description of what you need to retrieve.
 
0
•••
LOL its cool got it

I just needed to find out some information it was basicly a complex count statment I got pissed and rewrote it in ajax and it works so yea its done
 
0
•••
Rewrote it in Ajax?

Ajax opposed to what, traditional?

-Steve
 
0
•••
Coreycyberdesig said:
I have a signle table that has the following cols
thread_type_id thread_name poster post Date_posted thread_order thread_id
and a key

Coreycyberdesig said:
I need to figure out based on the thread type id
how many posts there has been for that thread type id minus the ones that are marked first
Code:
SELECT COUNT(the_key) FROM `your_single_table` 
WHERE thread_type_id = 'variable_for_that_thread_type_id' 
AND what_field_was_that != 'first'

Coreycyberdesig said:
How mnay are marked first
Code:
SELECT COUNT(the_key) FROM `your_single_table`
WHERE what_field_was_that = 'first'

Coreycyberdesig said:
and when the last post was made for that thread type id
Code:
SELECT MAX(Date_posted) FROM `your_single_table` 
WHERE thread_type_id = 'variable_for_that_thread_type_id'

There's not enough details or table illustration provided. You might want to merge these queries. :)
 
0
•••
php

Thanks i rewrote it in ajax and did the whole thing with an function
 
0
•••
Appraise.net

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back