Jump to content

now this problem


ccrevcypsys

Recommended Posts

I have to come up with a problem that makes the rows query before today has passed:

 

heres the code i have:

$todays_date = ;
$old_date= date(Ymd);
$final= $todays_date>$old_date;
$old_events_query="SELECT * FROM ".$glob['dbprefix']."StreamRush_events WHERE date = ".$final." AND customer_id=".$ccUserData[0]['customer_id'];

I think i might need to like subtract or add the date var. but im not sure. If someone can help please do.

Link to comment
https://forums.phpfreaks.com/topic/69966-now-this-problem/
Share on other sites

i have came up with a little more some thing but i dont know what to put in the middle of the equasion

$todays_date = date(Ymd);
$old_date= 20070101;
$final = $todays_date ?? $old_date;
$old_events_query="SELECT * FROM ".$glob['dbprefix']."StreamRush_events WHERE date = ".$final." AND customer_id=".$ccUserData[0]['customer_id'];

Link to comment
https://forums.phpfreaks.com/topic/69966-now-this-problem/#findComment-351426
Share on other sites

so this started to work then i added another one and it just put it down in the old the new one i put in was one for 2 days from now.

 

$date = date(Ymd);
$query="SELECT * FROM ".$glob['dbprefix']."StreamRush_events WHERE date = ".$date." AND customer_id=".$ccUserData[0]['customer_id'];

//old events
$old_events_query="SELECT * FROM ".$glob['dbprefix']."StreamRush_events WHERE date != ".$date." AND customer_id=".$ccUserData[0]['customer_id'];

Link to comment
https://forums.phpfreaks.com/topic/69966-now-this-problem/#findComment-351465
Share on other sites

You're missing the double quotes before the colon at the end of the sql queries

 

$date = date(Ymd);

$query="SELECT * FROM ".$glob['dbprefix'].".StreamRush_events WHERE date = ".$date." AND customer_id=".$ccUserData[0]['customer_id'].";

 

//old events

$old_events_query="SELECT * FROM ".$glob['dbprefix'].".StreamRush_events WHERE date != ".$date." AND customer_id=".$ccUserData[0]['customer_id'].";

 

Link to comment
https://forums.phpfreaks.com/topic/69966-now-this-problem/#findComment-351476
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.