Re: [PHP] SQL statement - please help

2005-03-24 Thread Tom Rogers
Hi, Thursday, March 24, 2005, 6:50:38 PM, you wrote: J> Dear all J> Please, I realy need your help. I am trying to extract only those records J> that were entered during the past hour from my MySQL database. The J> following SQL statement extracts all the records. As soon as I change the J> INT

RE: [PHP] SQL statement - please help

2005-03-24 Thread Jay Blanchard
[snip] $sql = "Select tblchatglobal.cgid, tblchatglobal.cgdateposted, tblchatglobal.cgtimeposted, tblchatglobal.uid, tblchatglobal.cgmsg, tblusers.uid, tblusers.uusername from tblchatglobal, tblusers where (tblchatglobal.uid = tblusers.uid) and (DATE_SUB(CURDATE(),INTERVAL 1 HOUR) <= tblchatgl

[PHP] SQL statement - please help

2005-03-24 Thread Jacques
Dear all Please, I realy need your help. I am trying to extract only those records that were entered during the past hour from my MySQL database. The following SQL statement extracts all the records. As soon as I change the INTERVAL to 1 HOUR I see all the records in my database. When I chan

Re: [PHP] SQL statement - date

2005-03-23 Thread Jesper Goos
take a look here http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html the first example should help you... regards jesper Jacques wrote: How should I formulate my sql statement to create a result set of members who registered between now and 7 days ago? I have tried the following and

[PHP] SQL statement - date

2005-03-23 Thread Jacques
How should I formulate my sql statement to create a result set of members who registered between now and 7 days ago? I have tried the following and it is obviously incorrect: $sqlnewmembers = "Select uid, uprofilename from tblusers where udatereg between (date() and date() - 7)"; Regards Jacq

Re: [PHP] sql statement help needed

2004-06-30 Thread Binay
- Original Message - From: "Chris W. Parker" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 01, 2004 3:33 AM Subject: [PHP] sql statement help needed > hello, > > i've had to change some of my tables to accomodate some greater &

[PHP] sql statement help needed

2004-06-30 Thread Chris W. Parker
hello, i've had to change some of my tables to accomodate some greater flexibility in the application that uses it and because of this i need to go through and update all the records. i've done one table by hand and it had about 100 records and took about 20 minutes. but this next table has about

Re: [PHP] SQL statement

2003-09-28 Thread sfdgfg
Curt Zirzow wrote: * Thus wrote Dan J. Rychlik ([EMAIL PROTECTED]): Well, we have a word for myself that over looks things and takes things literal. Its called "pencil smoke" It means dump, dunce, and lost. Jennifer was right, their was an error in my SQL query. technically it was an error in

Re: [PHP] SQL statement

2003-09-23 Thread Curt Zirzow
* Thus wrote Dan J. Rychlik ([EMAIL PROTECTED]): > Well, we have a word for myself that over looks things and takes things > literal. Its called "pencil smoke" It means dump, dunce, and lost. > > Jennifer was right, their was an error in my SQL query. technically it was an error in the code no

Re: [PHP] SQL statement

2003-09-23 Thread Curt Zirzow
* Thus wrote Jennifer Goodie ([EMAIL PROTECTED]): > > http://www.mysql.com/doc/en/Reserved_words.html > > > > [snip] > > 6.1.7 Is MySQL Picky About Reserved Words? > > > > A common problem stems from trying to create a table with column > > names that use the names of datatypes or functions built i

Re: [PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
ECTED]>; "Chris W. Parker" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, September 23, 2003 7:50 PM Subject: Re: [PHP] SQL statement > I tried this, and it failed. Thank you for the suggestion! > > - Original Message - > From: "Cody Phanekham

RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
> Thank you for your time on this. No problem. > > // Function that runs reports on logon history > > function logonHist() { > > db_connect(); //establish connection > > $_qlogonhist = ("SELECT username,host_info,status, DATE_FORMAT(timestamp, > '%d%m%y') > as formatted_ts FROM custlogon

RE: [PHP] SQL statement

2003-09-23 Thread Javier Muniz
You need to change timestamp to formatted_ts in your php code. -Original Message- From: Dan J. Rychlik [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 5:45 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] SQL statement Thank you for your time on this. I do

Re: [PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
AIL PROTECTED]> Sent: Tuesday, September 23, 2003 7:43 PM Subject: RE: [PHP] SQL statement > http://www.mysql.com/doc/en/Reserved_words.html > > [snip] > 6.1.7 Is MySQL Picky About Reserved Words? > > A common problem stems from trying to create a table with column names that

RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
> http://www.mysql.com/doc/en/Reserved_words.html > > [snip] > 6.1.7 Is MySQL Picky About Reserved Words? > > A common problem stems from trying to create a table with column > names that use the names of datatypes or functions built into > MySQL, such as TIMESTAMP or GROUP. You're allowed to do it

Re: [PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
n J. Rychlik" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, September 23, 2003 7:39 PM Subject: RE: [PHP] SQL statement > > > > Jennifer, you're right, I am using fetch_array... I tried to use your > > > > suggestion, and it failing as well, It

RE: [PHP] SQL statement

2003-09-23 Thread Cody Phanekham
mestamp to something else and see if that helps? > -Original Message- > From: Dan J. Rychlik [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 24 September 2003 10:32 > To: [EMAIL PROTECTED]; Chris W. Parker; > [EMAIL PROTECTED] > Subject: Re: [PHP] SQL statement > > &

RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
> > > Jennifer, you're right, I am using fetch_array... I tried to use your > > > suggestion, and it failing as well, It wont even execute > > > > > > > There's probably an error in my SQL syntax. What is > mysql_error() telling > > you? > I dont believe it to be an error because Ive run thi

Re: [PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
" <[EMAIL PROTECTED]>; "Chris W. Parker" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, September 23, 2003 7:15 PM Subject: RE: [PHP] SQL statement > > Ive used this > > $query = ("SELECT username, password, DATE_FORMAT(timestamp, > >

Re: [PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
Parker" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, September 23, 2003 7:25 PM Subject: RE: [PHP] SQL statement > > Jennifer, you're right, I am using fetch_array... I tried to use your > > suggestion, and it failing as well, It wont even execu

Re: [PHP] SQL statement

2003-09-23 Thread Raquel Rice
On Tue, 23 Sep 2003 19:10:29 -0500 "Dan J. Rychlik" <[EMAIL PROTECTED]> wrote: > Ive used this > $query = ("SELECT username, password, DATE_FORMAT(timestamp, > '%d%m%y') FROM custlogon"); > > But I recieve unknown index timestamp. *shrug* > Is "timestamp" an actual columnname in your table?

RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
> try this: > > $query = "SELECT username, password, > DATE_FORMAT(CURRENT_TIMESTAMP(), '%d%m%y') FROM custlogon"; > > or if that doesnt work try: > > $query = "SELECT username, password, DATE_FORMAT(NOW(), '%d%m%y') > FROM custlogon"; [snip] original query as posted: SELECT username, password, DAT

RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
> Jennifer, you're right, I am using fetch_array... I tried to use your > suggestion, and it failing as well, It wont even execute > > Do you have a better method of looping through all these records?? > There's probably an error in my SQL syntax. What is mysql_error() telling you? If it wa

RE: [PHP] SQL statement

2003-09-23 Thread Cody Phanekham
(CURRENT_TIMESTAMP(), '%d%m%y') FROM custlogon"; or if that doesnt work try: $query = "SELECT username, password, DATE_FORMAT(NOW(), '%d%m%y') FROM custlogon"; > -Original Message- > From: Dan J. Rychlik [mailto:[EMAIL PROTECTED] > Sent: Wednesday,

Re: [PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
; To: "Dan J. Rychlik" <[EMAIL PROTECTED]>; "Chris W. Parker" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, September 23, 2003 7:15 PM Subject: RE: [PHP] SQL statement > > Ive used this > > $query = ("SELECT username, password, DATE_

RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
> Ive used this > $query = ("SELECT username, password, DATE_FORMAT(timestamp, > '%d%m%y') FROM > custlogon"); > > But I recieve unknown index timestamp. *shrug* > > You are receiving the error on an array returned by fetch_array? If so, it is because the index is "DATE_FORMAT(timestamp, '%d%m%y

Re: [PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, September 23, 2003 7:07 PM Subject: RE: [PHP] SQL statement > Dan J. Rychlik <mailto:[EMAIL PROTECTED]> > on Tuesday, September 23, 2003 4:58 PM said: > > > I know its failing because php doesnt like the quot

RE: [PHP] SQL statement

2003-09-23 Thread Chris W. Parker
Dan J. Rychlik on Tuesday, September 23, 2003 4:58 PM said: > I know its failing because php doesnt like the quotation before the > format parameters. Ive tried to fix this without any luck. Any > Ideas ? It's failing because the ' before the %d is closing the s

[PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
Hello, Im having a bit of trouble with the DATE_FORMAT function in mysql. $query = ('SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon'); I know its failing because php doesnt like the quotation before the format parameters. Ive tried to fix this without any luck.

Re: [PHP] SQL Statement

2002-06-19 Thread èdy kurniawan
ect USER From DUAL) And AUDSID =(Select USERENV('SESSIONID') From DUAL)"; great thanks in advance to michi... ^_^ - Original Message - From: "èdy kurniawan" <[EMAIL PROTECTED]> Subject: Re: [PHP] SQL Statement > thanks to michi for ASAP response... >

Re: [PHP] SQL Statement

2002-06-18 Thread w . w . w
this is the problem: $query = "Select OSUSER >From v$session Where USERNAME = (Select USER From DUAL) And AUDSID =(Select USERENV('SESSIONID') From DUAL)"; 1. mysql does NOT support subselects! 2. delete the "<" in front of "FROM" 3. you have to quote "v$session": "v\$session" start with a shor

[PHP] SQL Statement

2002-06-18 Thread èdy kurniawan
Hello PHP mania, I'm a newcomer right here, i just wanna ask a litle dummy question : I put the SQL below into my SQL Plus editor : ** Select OSUSER >From v$session Where USERNAME = (Select USER From DUAL) And AUDSID =(Select USERENV('SESSIONID') From DUAL)

RE: [PHP] SQL statement for clearing a table

2001-06-22 Thread Chadwick, Russell
://www.toolshed51.com -Original Message- From: Wilbert Enserink [mailto:[EMAIL PROTECTED]] Sent: Friday, June 22, 2001 5:18 AM To: [EMAIL PROTECTED] Subject: [PHP] SQL statement for clearing a table Hi all, anybody knows the mysql statement for clearing the contents of a table and

RE: [PHP] SQL statement for clearing a table

2001-06-22 Thread ckieninger
$query = "delete * from table"; table is empty mailto:[EMAIL PROTECTED] -Original Message- From: Wilbert Enserink [mailto:[EMAIL PROTECTED]] Sent: Freitag, 22. Juni 2001 14:18 To: [EMAIL PROTECTED] Subject: [PHP] SQL statement for clearing a table Hi all, anybody knows

RE: [PHP] SQL statement for clearing a table

2001-06-22 Thread Merio, Quinn
isn't it, DELETE FROM tablename; q. -Original Message- From: Wilbert Enserink [mailto:[EMAIL PROTECTED]] Sent: Friday, June 22, 2001 6:18 AM To: [EMAIL PROTECTED] Subject: [PHP] SQL statement for clearing a table Hi all, anybody knows the mysql statement for clearing the con

RE: [PHP] SQL statement for clearing a table

2001-06-22 Thread Balak, Frank
delete from tablename -Original Message- From: Wilbert Enserink [mailto:[EMAIL PROTECTED]] Sent: Friday, June 22, 2001 07:18 To: [EMAIL PROTECTED] Subject: [PHP] SQL statement for clearing a table Hi all, anybody knows the mysql statement for clearing the contents of a table and

Re: [PHP] SQL statement for clearing a table

2001-06-22 Thread py
if you have a numbered primary key, delete from table where primary_key > 0 ? (to be handled with care) py - Original Message - From: Wilbert Enserink <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 22, 2001 1:17 PM Subject: [PHP] SQL statement for c

RE: [PHP] SQL statement for clearing a table

2001-06-22 Thread Jason Lustig
This SQL statement: "DELETE FROM myTable;" That should work... pretty much, unless you give a WHERE statement, it will do whatever you want (UPDATE, SELECT, DELETE, etc) to every record in the table. --Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PRO

Re: [PHP] SQL statement for clearing a table

2001-06-22 Thread Julia A. Case
try delete from table; Julia Quoting Wilbert Enserink ([EMAIL PROTECTED]): > Hi all, > > anybody knows the mysql statement for clearing the contents of a table and > lieving the table itself intact? > > Wilbert > > - > Pas de Deux > Van Mierisstraat 25 > 2526 NM Den

Re: [PHP] SQL statement for clearing a table

2001-06-22 Thread Adam Wright
DELETE FROM table_name; adamw - Original Message - From: "Wilbert Enserink" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 22, 2001 1:17 PM Subject: [PHP] SQL statement for clearing a table > Hi all, > > anybody knows the mysql statement

Re: [PHP] SQL statement for clearing a table

2001-06-22 Thread lenar
DELETE FROM tablename or TRUNCATE TABLE tablename lenar. ""Wilbert Enserink"" <[EMAIL PROTECTED]> wrote in message 001101c0fb15$5daa49e0$[EMAIL PROTECTED]">news:001101c0fb15$5daa49e0$[EMAIL PROTECTED]... > Hi all, > > anybody knows the mysql statement for clearing the contents of a table and

[PHP] SQL statement for clearing a table

2001-06-22 Thread Wilbert Enserink
Hi all, anybody knows the mysql statement for clearing the contents of a table and lieving the table itself intact? Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -

Re: [PHP] SQL statement in PHP

2001-02-16 Thread William N. Zanatta
Matt, Maybe the mistake is at the quotes... Just replace the double quotes inside the select statement by single quotes... Try something like: $sql = "select Business_Name,Trading_Details where Business_Type='Consultancy' and Bassingbourn != '0' from Main";

[PHP] SQL statement in PHP

2001-02-16 Thread Matt Davis
Can anybody help with this If I put the following statement in PHP my browser tells me that there is an error on the line. //create sql statement $sql = "select Business_Name,Trading_Details where Business_Type = "Consultancy" and Bassingbourn != "0" from Main"; If I remove where B