Wow. This is incredible. I actually just sent an email to my boss to order your book. (... and just got a reply back to go ahead and order it)
So the other thing is, After reviewing the table structure (rather than the old code), there's actually 4 levels to this whole relationship schema...
I'm trying to lookup some totals by state in these 3 tables. We have a league table, which contains the state column, then we have a team table which has a reference back to league, then we have a member table which references back to the team table. I'm trying to figure out how to get totals on...
I'm trying to pull statistics from 2 tables. Here's what happens:
An affiliate sends out emails to 10 (or so) people.
One of those people sends out an email to 5 people.
One of those 5 sends out a video to 2 people.
I need to track the total resulted from the original 10 sent out, which should...
Ok. I'm not exaclty sure if I'm doing this right. I want to select [these fields] from affiliate and join `user` (there should always be a corresponding record on user and it should not return anything if there isn't), then I want to join image (where there may or may not be an image, but it...
Thanks a bunch rudy! Thanks also for explaining what's going on. it makes a lot more sense now, and I have learned something new as a result of it! I appreciate it!
the strange thing is this was working on the testing server. and now that i've moved it to the live server with the exact same table schema/data, it throws this error. I've checked to make sure I'm using the correct Database. Select statements are working elsewhere on the site. Not sure what's...
My query returns with this error:
Unknown column 'u.user_id' in 'on clause'
Here's the query:
SELECT u.user_id AS id, a.affiliate_id AS a_id,
u.phone, u.city, u.state, u.email,
a.company, a.username, a.contact, a.address, a.zip, a.subscribed...
I'm trying to output a grid view of year/month data from a table using this query:
SELECT
COUNT(`id`) AS `total`, DATE_FORMAT(`report_date`,'%Y-%m') AS `group_date`,
DATE_FORMAT(`report_date`,'%Y') AS `report_year`, DATE_FORMAT(`report_date`,'%m') AS `report_month`...
I ended up resolving my issue by placing each of my non-grouped columns into aggregate functions, example:
SELECT Id, MAX(First_Name) AS First_Name, MAX(Last_Name) AS Last_NAME FROM table WHERE Last_Name IS NOT NULL GROUP BY Id ORDER BY Last_Name ASC, First_Name ASC
and for pagination (page 3...
I've setup a query for Pagination, however now I'm seeing that some of these records have duplicate information. I want to only group these records by a few of the columns, but also want other information along with the records. I'm used to MySQL and the Limit 0,50 feature.
So, my query (page 3...
Yeah, i'll probably do that for now, although the compact code you sent me doesn't seem to work. It's not that important because I think i've gotten plenty of good suggestions to code the the "right way".
As for my solution, any other variables on the page I may need (other than the 2 i will...
Well, that's not exactly how i'm using it.
I have a file above the headers called process.php which allows me to process forms on any given page. It keeps all of this similar code in one file and separate from other stuff.
Then I'm including my page content. The issue comes when the page is a...
Wow, #3 is exactly what i was looking for. And it seems much better than my recently discovered solution:
<?php
reset($GLOBALS);
while(list($key,$val)=each($GLOBALS)){
if(($key==strstr($key,"HTTP_")) || (strstr($key,"_")==$key))
continue;
//eval("global $".$key.";");
global ${$key};
}...
I'm trying to setup a class that will allow a file to be included on the page. It goes something like:
<?php
class myClass {
... ... ...
function includeFile(){
if(file_exists($this->include_file)){
include($this->include_file);
} else {...
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.