Code Comments
Programming Forum and web based access to our favorite programming groups.Hi everyone and all,
I would like to know if something like this is possible. Let say $minus_me
is an integer from 0 to 15
$result = mysql_query('SELECT * FROM myTable WHERE Date > NOW() -
"$minus_me" ;');
Jean
--
--
http://jeanpierredaviau.com
Post Follow-up to this messageI must add I tried it and other possibilities without success. Maybe ther is another way to do it. Jean
Post Follow-up to this messageOn Mon, 20 Sep 2004 12:27:45 -0400, Québec wrote:
> Hi everyone and all,
>
> I would like to know if something like this is possible. Let say
> $minus_me is an integer from 0 to 15
>
> $result = mysql_query('SELECT * FROM myTable WHERE Date > NOW() -
> "$minus_me" ;');
Your problem arises from using single quotes.
$result = mysql_query('SELECT * from myTable WHERE Date > NOW() - " .
$minus_me );
Also, if $minus_me is coming from a web form, be sure to verify that it
is, in fact, an integer within your specified range.
HTH,
La'ie Techie
Post Follow-up to this message
"La?ie Techie" <laie@win_remove_get_nospam_solutions.com> a écrit dans le
message de news:1095829851.Cg6gS4BHmw0Q4Fx4cCQNqA@teranews...
> On Mon, 20 Sep 2004 12:27:45 -0400, Québec wrote:
>
>
> Your problem arises from using single quotes.
>
> $result = mysql_query('SELECT * from myTable WHERE Date > NOW() - " .
> $minus_me );
>
> Also, if $minus_me is coming from a web form, be sure to verify that it
> is, in fact, an integer within your specified range.
>
> HTH,
> La'ie Techie
>
$minusInt = (int)($_SERVER['QUERY_STRING']+1);
$result = mysql_query("SELECT * FROM etudiants WHERE date > NOW()-
'$minusInt';");
Thank you very much,
Jean Pierre
Post Follow-up to this messageLook for DATEADD in the MySQL manual
-Charles
"Québec" <Once@WasEno.ugh> wrote in message
news:yTk4d.65356$ir6.2219198@wagner.videotron.net...
>
> "La?ie Techie" <laie@win_remove_get_nospam_solutions.com> a écrit dans le
> message de news:1095829851.Cg6gS4BHmw0Q4Fx4cCQNqA@teranews...
>
> $minusInt = (int)($_SERVER['QUERY_STRING']+1);
> $result = mysql_query("SELECT * FROM etudiants WHERE date > NOW()-
> '$minusInt';");
>
> Thank you very much,
>
> Jean Pierre
>
>
>
Post Follow-up to this messageThanks, Jean Pierre Or are you talking "Charles Pelkey" <c.e.pelkey@sbcglobal.net> a écrit dans le message de news:OpG5d.13763$yp2.12992@newssvr30.news.prodigy.com... > Look for DATEADD in the MySQL manual > > -Charles > > "Québec" <Once@WasEno.ugh> wrote in message > news:yTk4d.65356$ir6.2219198@wagner.videotron.net... le it > >
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.