Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.