Checkbox not between date

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I get a database for « News » on Internet.
Side Admin, I would like a form to know witch "News" are Online or

In my database mysql I get :


Outside this date, the « News » are unvisible.

In my form I put a checkbox « Off_line »

If it's check, all the news outside Date_start
And Date_end  must be visible.

I tryed like this

In Head :
if (isset($HTTP_GET_VARS["date_off"]))
$ date_off =$HTTP_GET_VARS["date_off"];
$ date_off =0;

In my form for checkbox :
<input <?php if  ("CURRENT_DATE NOT BETWEEN $row_R_news['date_start']
AND $row_R_news['date_end'] ",1) {echo "checked=\"checked\"";} ?>
name=" date_off " type="checkbox" id=" date_off " value="1">

For my request sql :
SELECT t_news.*
FROM t_news
WHERE  $date_off

Thanks to help me, pascal

Re: Checkbox not between date

elia wrote:
Quoted text here. Click to load it

First of all, what do actually get on your page?  Next, have you looked at the  
generated source?

One possibility I see is:

{echo "checked=\"checked\"";} ?>

Looks like you don't have any space before name= if the box is checked.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: Checkbox not between date

Simply remove your WHERE condition from your SQL query when looking for
outdated news:
select * from t_news;
That's it!

Site Timeline