Page 1 of 1
Help plz (again)!
Posted: Sun Sep 15, 2002 7:51 am
by DynamiteHost
You people have been great over the last couple of days (especially hob_goblin). Now I need some more code
Code: Select all
if (between $today-7 and $today) {
stuff here
}
else {
nothing
}
Problem is, It would have to read from a mysql table instead of doing the IF.... I think
Hope you aren't confused like me

Posted: Sun Sep 15, 2002 7:58 am
by DynamiteHost
I've just been thinking and I may have come up with a solution to my problem
Just wondering is this the best way and would it work?
Code: Select all
mysql_query = select * from table etc
if ($tableinfo >= $today-7 && $tableinfo <= $today) {
stuff here
}
else {
other stuff
}
Posted: Mon Sep 16, 2002 5:20 pm
by Takuma
Yes it would and that's probably the only code you could use
Posted: Mon Sep 16, 2002 5:23 pm
by phice
DynamiteHost wrote:I've just been thinking and I may have come up with a solution to my problem
Just wondering is this the best way and would it work?
Code: Select all
mysql_query = select * from table etc
if ($tableinfo >= $today-7 && $tableinfo <= $today) {
stuff here
}
else {
other stuff
}
Code: Select all
mysql_query = select * from table etc
if (($tableinfo >= $today-7) && ($tableinfo <= $today)) {
stuff here
}
else {
other stuff
}
Posted: Mon Sep 16, 2002 6:54 pm
by hob_goblin
Code: Select all
$qry = mysql_query("select * from table")
$data = mysql_fetch_assoc($qry);
$tableinfo = $dataї'day']; // or whatever the column is named
$today = date("d");
if(($today-7) < 0){
$week = 0;
} else {
$week = $today-7;
}
if (($tableinfo >= $week) && ($tableinfo <= $today)) {
//stuff
}
else {
//other stuff
}
you know, something like that.
Posted: Mon Sep 16, 2002 7:03 pm
by jason
DynamiteHost: What are you trying to do exactly?