RE: [PHP-DB] Date comparison problem

2002-07-11 Thread Gabor Niederlaender

But I would like to do it the other way round. I mean for the solution
you have mentioned, I have to make the query on the whole record, then
compare the two dates and filter the right ones. I'd like to make the
query look like:

SELECT something FROM table WHERE datetime  $form_date

So I think I have to adjust the form of my $form_date.

Or am I making a mistake somewhere?

Thanx
Gabor

---
 This is how I do it:
 
 date(m/d/Y,strtotime(odbc_result($rs,ts)))
 
 where $rs is the result set and ts is the name of the field
containing the datetime.
 
  Ryan
 
 -Original Message-
 From: Gabor Niederlaender [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 10, 2002 8:21 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Date comparison problem
 
 
 Hi all!
 
 I have got a datetime field in a MS-SQL DB, and I have a date
 field in my html-form with the format: DD/MM/.
 
 I would like to compare the two, but I think the two formats are a
bit
 different and they do not really want to be compared:)
 
 If I write a query to write out the datetime field from the DB, I
 get the form :
 
 02 05 2002 12:25 
 
 In the HTML-form it looks a bit different: 12/10/2000
 
 I do not really want to explode the form-data and than build a new
 timestamp, it has to be a more simple way.
 
 Thanks, best regards
 
 Gabor
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] RH7.3+Oracle9i(9.2.0)Client+PHP4.2.1+Apache1.3.26

2002-07-11 Thread Hubert ADGIE

in a76999.pdf
[
ORA-00909 invalid number of arguments
Cause: An Oracle function was referenced with an incorrect number of
arguments. All Oracle functions, except for SYSDATE, require at least one
argument.
Action: Correct the syntax of the function by entering the required number of
arguments.
]

So it seems like if your are using an Oracle function within our statement.
Is that true ?

At 11/07/2002 06:56, Gordon Yeung wrote:
I'm just upgrading Linux Server to RH7.3 and installed
Oracle9i(9.2.0) Client+PHP4.2.1+Apache1.3.26

Everything goes smoothly. However, when I access the
Oracle server by means of PHP, it gives the following error:

Warning: OCIStmtExecute: ORA-00909: invalid number of arguments

The line that cause the error is:

$result = ociexecute($cursor);

The same PHP is running well in my old server
(RH6.2+Oracle8i(8.0.x)+PHP4.0.3+Apache1.3.12).

Can anyone here give me advice ?

Thanks
Gordon Yeung


-- 
Hubert ADGIE
[EMAIL PROTECTED]
Tel : +33 5 53 88 00 76
Fax : +33 5 53 88 01 16


[PHP-DB] php-security

2002-07-11 Thread Gabor Niederlaender

Hi all!

One can see in every php manual and install hint, that you have to
consider security issues if you install php as a CGI, but I cannot
really imagine what this means. 
What security issues? 
Can someone tell me an example, what can happen?

Best regards,
Gabor

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Date comparison problem

2002-07-11 Thread joakim . andersson

Hi,

Assuming your dates have the format you specified and that you only want to
compare dates, not time aswell.

$str_sql = SELECT something FROM mytable WHERE LEFT(my_datetime, 10) = ' .
str_replace(/,  , $form_date) . ';
or if day / month is reversed in MSSQL
$str_sql = SELECT something FROM mytable WHERE LEFT(my_datetime, 10) = ' .
substr($form_date, 3, 2) .   . substr($form_date, 0, 2) .   .
substr($form_date, 6, 4) . ';

Regards
Joakim Andersson


 -Original Message-
 From: Gabor Niederlaender [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 11, 2002 8:36 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Date comparison problem
 
 
 But I would like to do it the other way round. I mean for the solution
 you have mentioned, I have to make the query on the whole record, then
 compare the two dates and filter the right ones. I'd like to make the
 query look like:
 
 SELECT something FROM table WHERE datetime  $form_date
 
 So I think I have to adjust the form of my $form_date.
 
 Or am I making a mistake somewhere?
 
 Thanx
 Gabor
 
 ---
  This is how I do it:
  
  date(m/d/Y,strtotime(odbc_result($rs,ts)))
  
  where $rs is the result set and ts is the name of the field
 containing the datetime.
  
   Ryan
  
  -Original Message-
  From: Gabor Niederlaender [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, July 10, 2002 8:21 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] Date comparison problem
  
  
  Hi all!
  
  I have got a datetime field in a MS-SQL DB, and I have a date
  field in my html-form with the format: DD/MM/.
  
  I would like to compare the two, but I think the two formats are a
 bit
  different and they do not really want to be compared:)
  
  If I write a query to write out the datetime field from the DB, I
  get the form :
  
  02 05 2002 12:25 
  
  In the HTML-form it looks a bit different: 12/10/2000
  
  I do not really want to explode the form-data and than build a new
  timestamp, it has to be a more simple way.
  
  Thanks, best regards
  
  Gabor
  
  -- 
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  
  -- 
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] MSSQL functions vs. ODBC functions

2002-07-11 Thread Mark McCulligh

I am not sure if this question has been asked before, If so sorry for asking
again.

I have a site that the Client is moving from a MySQL db to Microsoft SQL
Server.
Is it better to setup an ODBC connection to SQL Server and use the ODBC
functions OR to use the MSSQL functions.  If I have the choice with is
better or are they about the same.  Logic would say ODBC is slower because
it is another layer on top of the DB, but I don't know.

Mark.

_
Mark McCulligh, Application Developer / Analyst
Sykes Canada Corporation www.SykesCanada.com
(888)225-6824 ex. 3262
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] phpMyAdmin for Windows?

2002-07-11 Thread Mark McCulligh

I have a site that is on a Windows Server : and having problems with the
Hoster giving me telnet access to Admin MySQL.  Is there some thing like
phpMyAdmin for Windows.  I want to put it in a folder on my site to manage
the DB.

I thought of developing my own, but why build it if it exist already.

Thanks, Mark.

_
Mark McCulligh, Application Developer / Analyst
Sykes Canada Corporation www.SykesCanada.com
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] phpMyAdmin for Windows?

2002-07-11 Thread Ryan Jameson (USA)

phpMyAdmin uses PHP and PHP is available for windows. So if I understand your 
question, the answer is yes, there is something LIKE phpMyAdmin for Windows. It is not 
a windows application though.

 Ryan

-Original Message-
From: Mark McCulligh [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 11, 2002 10:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] phpMyAdmin for Windows?


I have a site that is on a Windows Server : and having problems with the
Hoster giving me telnet access to Admin MySQL.  Is there some thing like
phpMyAdmin for Windows.  I want to put it in a folder on my site to manage
the DB.

I thought of developing my own, but why build it if it exist already.

Thanks, Mark.

_
Mark McCulligh, Application Developer / Analyst
Sykes Canada Corporation www.SykesCanada.com
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] phpMyAdmin for Windows?

2002-07-11 Thread Eugene Mah

If you have a local webserver with PHP installed, all you should need
to do is install phpMyAdmin on your local server
and configure phpMyAdmin to look for the databases on the
remote machine.

Start up your web browser, go to the phpMyAdmin URL that
you just installed on your local machine, and you should be able
to access the remote DB.

The other good thing about phpMyAdmin is you can configure
it to access multiple DB servers.

I have an installation of phpMyAdmin set up to access DB servers
on the local machine (Solaris) and also on a remote machine (Redhat Linux).
Works just fine

Eugene

At 12:48 11-07-02 -0400, Mark McCulligh wrote:
I have a site that is on a Windows Server : and having problems with the
Hoster giving me telnet access to Admin MySQL.  Is there some thing like
phpMyAdmin for Windows.  I want to put it in a folder on my site to manage
the DB.

I thought of developing my own, but why build it if it exist already.

Thanks, Mark.

_
Mark McCulligh, Application Developer / Analyst
Sykes Canada Corporation www.SykesCanada.com
[EMAIL PROTECTED]



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
-
Eugene Mah, M.Sc., DABR   [EMAIL PROTECTED]
Medical Physicist/Misplaced Canuck[EMAIL PROTECTED]
Department of Radiology   For I am a Bear of Very Little
Medical University of South Carolina   Brain, and long words Bother
Charleston, South Carolina me.   Winnie the Pooh
http://home.netcom.com/~eugenem/
PGP KeyID = 0x1F9779FD, 0x319393F4
PGP keys available on request ICQ 3113529 O-
-


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] phpMyAdmin for Windows?

2002-07-11 Thread Mark McCulligh


Thanks, I didn't know that phpMyAdmin could connect to another server
remotely.  I will give it a try.

Mark
_
Mark McCulligh, Application Developer / Analyst
Sykes Canada Corporation www.SykesCanada.com
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: Select string.

2002-07-11 Thread Jason Morehouse

Single quotes within the select work fine.

$login = mysql_query(SELECT * FROM Users WHERE Username = '$User_Name');

On Thu, 11 Jul 2002 06:47:54 +1200, Shiloh Madsen wrote:

 Yet another thing i need some quick help with. What is the proper way to 
 generate a select string in php. I know if youre trying to select a 
 value from a column you need to enclose it in double quotes if youre 
 doing it directly in sql. in this case the value in question is being 
 passed as a variable from a previous page. i have the current line for 
 selection in my page, but i dont think it is correct. any help?
 
 $login = mysql_query(SELECT * FROM Users WHERE Username =. $User_Name)


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] resource ID #3

2002-07-11 Thread Jonathan

I am a newbie to php (as i have announced several times on this bulletin
board =) so I thank you all for your help.

Mi problemo:

I have a database of events going on at local colleges.  The names of the
tables are the abbreviated names of the colleges.  I grab those with a 'SHOW
TABLES' command to the mysql que.  Then, I have a second database which
matches each abbreviation with the proper name.  When I try to run any query
on the second database, the only output I recieve is resource id #3  Any
suggestions?

Jonathan



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] resource ID #3

2002-07-11 Thread Beau Lebens

Jonathan,
most (all?) of the database query-related functions in PHP return a
Resource ID which contains the data resulting from your query. To access
that information, you need to pass the Resource ID thru a function like
(assuming u r using MySQL) mysql_fetch_array() or mysql_fetch_row()

Have a look at those 2 (or their equivalents for different DBs) in the
manual and go from there :)

HTH

Beau

// -Original Message-
// From: Jonathan [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 12 July 2002 9:18 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] resource ID #3
// 
// 
// I am a newbie to php (as i have announced several times on 
// this bulletin
// board =) so I thank you all for your help.
// 
// Mi problemo:
// 
// I have a database of events going on at local colleges.  The 
// names of the
// tables are the abbreviated names of the colleges.  I grab 
// those with a 'SHOW
// TABLES' command to the mysql que.  Then, I have a second 
// database which
// matches each abbreviation with the proper name.  When I try 
// to run any query
// on the second database, the only output I recieve is 
// resource id #3  Any
// suggestions?
// 
// Jonathan
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php