Ok, DRJ478, I played around a bit and got this query working na displaying only the user with the highest profile_current_hours, using the ORDER BY command and LIMIT 1 to display just the top user.
$query="SELECT *
FROM `smf_members` AS a
LEFT JOIN smf_themes AS b ON a.id_member =...
Ditto! Worked perfectly! And believe me, DRJ478, I am a quick learner. Just need a few examples of how to get things accomplished, and I figure out how to build on that. :-) But prepare, as I need yet another query!
Thanks for your help, and believe me, even though I have no programming knowledge, I enjoy trying to learn little by little.
Nonetheless, here is my next try at it but it still won't give me a result.
$query="SELECT count(a.id_member) FROM `smf_themes` AS a LEFT JOIN smf_themes AS b LEFT...
DRJ478, using the code I posted above, it will not display a result. I think it's missing something in the ON a.id_member = b.id_member part. Have no idea what to do.
Like this?
SELECT count(a.id_member) FROM `smf_themes` AS a LEFT JOIN smf_themes AS b LEFT JOIN smf_themes AS c ON a.id_member = b.id_member WHERE a.variable='profile_domicile' AND a.value='KMIA' AND b.variable='profile_division' AND b.value='APR' AND c.variable='profile_rank' AND...
To make it a bit clearer, now I need the query to give me the total amount of users that have
profile_domicile = KMIA
profile_division = APR
profile_rank = Trainee
Hope this is a bit clearer.
Ok, I have yet another question! Using the query supplied by DRJ478:
SELECT count(a.id_member) FROM `smf_themes` AS a LEFT JOIN smf_themes AS b ON a.id_member = b.id_member WHERE a.variable='profile_domicile' AND a.value='KMIA' AND b.variable='profile_division' AND b.value='APR'
How would...
DRJ478, your query WORKED LIKE A CHARM!!! WOW! I thought it would never be accomplished! I must say that this forum is simply INCREDIBLE! I have had a couple of problems resolved here where they were not been able to anywhere else. Amazing. Thanks a million to you and EVERYONE who chipped in...
karver, what I meant by saying that the result would be 1, I was referring to the piece of code I posted here. I didn't want to post here all 700+ rows that this table has.
Hi DRJ478,
That is exactly what I desperately need.
Here is the info you requested:
PHP 4.4.1
MySQL 4.1.13
thanks for your help, my friend. I'm on my Treo 650, so I will be monitoring this on the road! :-) Gotta love these cel phones! hahahah
Ok, that query is not giving the result I am looking for.
The problem is the way the database fields are arranged, it makes it extremely difficult to perform these queries. Intead of recored being arranges by rows, they are arranaged by columns... it's as if you take a regular database and...
Ok, tried that and still returns "0". Here is a small sample of table along with some data, so you can perhaps check it out and see how it would be best to accomplish what I am trying to do.
CREATE TABLE `smf_themes` (
`ID_MEMBER` mediumint(8) NOT NULL default '0',
`ID_THEME` tinyint(4)...
I am trying to ececute this query on a php file but just can't get it to work. I'm a newbie, so please don't laugh at my attempt! hahahahaha
What I need is to get the total amount of fields from a table named JOS_THEMES, where VARIABLE = PROFILE_DOMICILE and VALUE = KMIA and VARIABLE =...
I have a question. Can the form be made so that it sends the info to the page as it is right now AND send the info to a SECOND page? I would put the code on this second file and have the form page submit the data to this second file.
In other words, can the form be sent to 2 different files at...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.