Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

newbe
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



Report this thread to moderator Post Follow-up to this message
Old Post
Québec
09-20-04 08:57 PM


Re: newbe
I must add I tried it and other possibilities without success.

Maybe ther is another way to do it.

Jean



Report this thread to moderator Post Follow-up to this message
Old Post
Québec
09-21-04 08:56 PM


Re: newbe
On 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


Report this thread to moderator Post Follow-up to this message
Old Post
LÄÊ»ie Techie
09-22-04 08:55 AM


Re: newbe
"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



Report this thread to moderator Post Follow-up to this message
Old Post
Québec
09-23-04 01:57 AM


Re: newbe
Look 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
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Charles Pelkey
09-27-04 01:55 AM


Re: newbe
Thanks,



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 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Québec
09-27-04 08:57 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:13 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.