[PHP-DB] RE: PHP4 on Windows using MSSQL

2003-02-26 Thread Kevin Gordon
Thanks Ollie. I will check Tcp or Named Pipes.

I have found a Linux Journal article dated 14 Feb 2003 using a FreeTDS
driver and ODBC to MSSQL and will try that.
Cheers,
Kevin

On Tue, 2003-02-25 at 23:25, Oliver Cronk wrote:
 Yes, but I have never personally used Linux to connect to MSSQL so I can't
 really help you on that one.  Although I hear that several people have done
 this I would really recommend it (as Linux isn't a supported client O/S for
 MSSQL).  It is *fairly* straightforward on Windows - the hardest bit is
 making sure you have all the correct DLL's in the right places etc etc.
 
 I use MySQL/ Postgres these days so I can't really remember all the stuff I
 had to do to get MSSQL working with PHP but I will have a think and let you
 know if I think of anything that might be useful.
 
 After having another quick look at your error message at the bottom of your
 original email it might be worth looking at your MSSQL Server connection
 config dialogs - make sure that TCP/IP has been enabled (looks like you
 might just have named pipes).
 
 Regards
 
 Ollie Cronk
 
 -Original Message-
 From: Kevin Gordon [mailto:[EMAIL PROTECTED]
 Sent: 25 February 2003 08:05
 To: Oliver Cronk
 Cc: PHP Mail
 Subject: RE: PHP4 on Windows  using MSSQL
 
 
 Thanks Ollie
 I guess this means using PHP4 MSSQL functions in Windows and PHP4 Sybase
 functions in Linux?
 
 
 On Tue, 2003-02-25 at 04:47, Oliver Cronk wrote:
  The MSSQL module for PHP DOES NOT USE ODBC.  It uses the C library direct
  style of connecting to MSSQL.  Use your enterprise manager to configure
 the
  appropriate users and permissions and you should be fine.
 
  Ollie Cronk
  www.cronky.net
 
  -Original Message-
  From: Kevin Gordon [mailto:[EMAIL PROTECTED]
  Sent: 24 February 2003 07:09
  To: PHP Mail
  Subject: PHP4 on Windows  using MSSQL
 
 
  Hi Everyone,
 
  From a Linux session:
  ~ # telnet 10.1.1.1 1433
  Trying 10.1.1.1...
  Connected to 10.1.1.1.
  Escape character is '^]'.
  Connection closed by foreign host.
 
  From within NT4 Primary Domain Server:
  SQL Server Query Analyzer using the user login  password applied in PHP
  (and created in MSSQL) Queries processed ok.
 
  In PHP must I use NT authenticated login / password?
 
  Both a PHP client on Linux and Windows receive the same error message:
  Warning: SQL error: [Microsoft][ODBC SQL Server Driver][Named
  Pipes]Specified SQL server not found., SQL state 08001 in SQLConnect in
  E:\Inetpub\wwwroot\php\ODBC_Driver.php on line 174
 
  The PHP.ini file on NT4 has:
  **
  [MSSQL]
  ; Allow or prevent persistent links.
  mssql.allow_persistent = On
 
  ; Maximum number of persistent links.  -1 means no limit.
  mssql.max_persistent = -1
 
  ; Maximum number of links (persistent+non persistent).  -1 means no
  limit.
  mssql.max_links = -1
 
  ; Minimum error severity to display.
  mssql.min_error_severity = 10
 
  ; Minimum message severity to display.
  mssql.min_message_severity = 10
 
  ; Compatability mode with old versions of PHP 3.0.
  mssql.compatability_mode = Off
 
  ; Valid range 0 - 2147483647.  Default = 4096.
  ;mssql.textlimit = 4096
 
  ; Valid range 0 - 2147483647.  Default = 4096.
  ;mssql.textsize = 4096
 
  ; Limits the number of records in each batch.  0 = all records in one
  batch.
  ;mssql.batchsize = 0
 
  ; Use NT authentication when connecting to the server
  mssql.secure_connection = Off
 
  ; Specify max number of processes. Default = 25
  ;mssql.max_procs = 25
 
  
  ntwdblib.dll is in the correct Windows directory.
 
  Using a System DNS for ODBC. Should I be using a File DNS?
 
  Can I open up NT4 PDS to telenet to it?
 
  Any thoughts, comments?
  Many thanks,
 
  Kevin Gordon
  New Zealand
 
 
 
 
 
 
 



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



[PHP-DB] RE: PHP4 on Windows using MSSQL

2003-02-26 Thread Oliver Cronk
Sorry made a typo in my last email - I mean't to say wouldn't recommend it
rather than would (in reference to using MSSQL from Linux).

Hope you get the issue sorted

Cheers

Ollie

-Original Message-
From: Kevin Gordon [mailto:[EMAIL PROTECTED]
Sent: 26 February 2003 08:23
To: Oliver Cronk
Cc: PHP Mail
Subject: RE: PHP4 on Windows  using MSSQL


Thanks Ollie. I will check Tcp or Named Pipes.

I have found a Linux Journal article dated 14 Feb 2003 using a FreeTDS
driver and ODBC to MSSQL and will try that.
Cheers,
Kevin

On Tue, 2003-02-25 at 23:25, Oliver Cronk wrote:
 Yes, but I have never personally used Linux to connect to MSSQL so I can't
 really help you on that one.  Although I hear that several people have
done
 this I would really recommend it (as Linux isn't a supported client O/S
for
 MSSQL).  It is *fairly* straightforward on Windows - the hardest bit is
 making sure you have all the correct DLL's in the right places etc etc.

 I use MySQL/ Postgres these days so I can't really remember all the stuff
I
 had to do to get MSSQL working with PHP but I will have a think and let
you
 know if I think of anything that might be useful.

 After having another quick look at your error message at the bottom of
your
 original email it might be worth looking at your MSSQL Server connection
 config dialogs - make sure that TCP/IP has been enabled (looks like you
 might just have named pipes).

 Regards

 Ollie Cronk

 -Original Message-
 From: Kevin Gordon [mailto:[EMAIL PROTECTED]
 Sent: 25 February 2003 08:05
 To: Oliver Cronk
 Cc: PHP Mail
 Subject: RE: PHP4 on Windows  using MSSQL


 Thanks Ollie
 I guess this means using PHP4 MSSQL functions in Windows and PHP4 Sybase
 functions in Linux?


 On Tue, 2003-02-25 at 04:47, Oliver Cronk wrote:
  The MSSQL module for PHP DOES NOT USE ODBC.  It uses the C library
direct
  style of connecting to MSSQL.  Use your enterprise manager to configure
 the
  appropriate users and permissions and you should be fine.
 
  Ollie Cronk
  www.cronky.net
 
  -Original Message-
  From: Kevin Gordon [mailto:[EMAIL PROTECTED]
  Sent: 24 February 2003 07:09
  To: PHP Mail
  Subject: PHP4 on Windows  using MSSQL
 
 
  Hi Everyone,
 
  From a Linux session:
  ~ # telnet 10.1.1.1 1433
  Trying 10.1.1.1...
  Connected to 10.1.1.1.
  Escape character is '^]'.
  Connection closed by foreign host.
 
  From within NT4 Primary Domain Server:
  SQL Server Query Analyzer using the user login  password applied in PHP
  (and created in MSSQL) Queries processed ok.
 
  In PHP must I use NT authenticated login / password?
 
  Both a PHP client on Linux and Windows receive the same error message:
  Warning: SQL error: [Microsoft][ODBC SQL Server Driver][Named
  Pipes]Specified SQL server not found., SQL state 08001 in SQLConnect in
  E:\Inetpub\wwwroot\php\ODBC_Driver.php on line 174
 
  The PHP.ini file on NT4 has:
  **
  [MSSQL]
  ; Allow or prevent persistent links.
  mssql.allow_persistent = On
 
  ; Maximum number of persistent links.  -1 means no limit.
  mssql.max_persistent = -1
 
  ; Maximum number of links (persistent+non persistent).  -1 means no
  limit.
  mssql.max_links = -1
 
  ; Minimum error severity to display.
  mssql.min_error_severity = 10
 
  ; Minimum message severity to display.
  mssql.min_message_severity = 10
 
  ; Compatability mode with old versions of PHP 3.0.
  mssql.compatability_mode = Off
 
  ; Valid range 0 - 2147483647.  Default = 4096.
  ;mssql.textlimit = 4096
 
  ; Valid range 0 - 2147483647.  Default = 4096.
  ;mssql.textsize = 4096
 
  ; Limits the number of records in each batch.  0 = all records in one
  batch.
  ;mssql.batchsize = 0
 
  ; Use NT authentication when connecting to the server
  mssql.secure_connection = Off
 
  ; Specify max number of processes. Default = 25
  ;mssql.max_procs = 25
 
  
  ntwdblib.dll is in the correct Windows directory.
 
  Using a System DNS for ODBC. Should I be using a File DNS?
 
  Can I open up NT4 PDS to telenet to it?
 
  Any thoughts, comments?
  Many thanks,
 
  Kevin Gordon
  New Zealand
 
 
 








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



Re: [PHP-DB] Multiple select box using mysql

2003-02-26 Thread Jason End
Yeah, I think I am going to reconsider the software
box. The idea I have now is to have an Add Expert
link attached to each software entry, which will then
load a page to add experts to that piece of software.
The page could contain two select boxes, one with a
list of all experts, and one with a list of current
experts for that software. The admin could then add
experts from one list to the other.

Jay

--- Mark [EMAIL PROTECTED] wrote:
 I'm not sure if anyone answered this for you, and
 perhaps I'm missing
 something. Are you simply trying to populate a
 multi-select box with
 MySQL data?
 
 If so, try this:
 echo form tag here...
 echo SELECT NAME=\software[]\ MULTIPLE SIZE=5;
 $query=select ID, Name, Version from software;
 $result=mysql_query($query) or die(Could not query
 database);
 while ($row=mysql_fetch_array($result)) {
   echo OPTION

VALUE=\{$row[ID]}\{$row[Name]}-{$row[Version]}/OPTION;
 //
 software select row format Name-Version
 }
 echo /SELECT;
 
 echo SELECT NAME=\expert[]\ MULTIPLE SIZE=5;
 $query=select ID, Name from experts;
 $result=mysql_query($query) or die(Could not query
 database);
 while ($row=mysql_fetch_array($result)) {
   echo OPTION
 VALUE=\{$row[ID]}\{$row[Name]}/OPTION;
 }
 echo /SELECT;
 echo /FORM;
 
 This will provide you with a form to link the
 experts and software.
 
 To actually do the linking, you need to insert the
 data in to the DB.
 The action to perform when submitting the form might
 be something
 like this (just steps, not code)
 
 Confirm arrays have data
 loop through $software array {
 loop through $experts array {
 build an insert SQL statement to insert the software
 table ID and the
 expert table ID into a lookup table.
 execute the insert statement
 }
 }
 
 For example,
 
 if (isset($software)  isset($expert)) {
   for ($i=0;$icount($software);$i++) {
 for ($j=0;$jcount($expert);$j++} {
   $query=insert into lookuptbl set
 software=\{$software[$i]}\,
 expert=\{$export[$j]\;
   $result=mysql_query($query) or die(Could not
 insert data);
 }
   }
 } else {
 error handling routine here
 }
 
 
 You might want to reconsider making the software
 selection box
 multiselect. That will allow many to many
 relationships. If that's
 what you want, that's ok. But it allows for a lot of
 user error.
 Eliminating it would eliminate the outer loop, it
 would make
 $software a standard variable rather than an array,
 and you could
 remove the [] from the SELECT form element for the
 software.
 
 Please check all code, as it's off the top of my
 head, and not
 verified at all.
 
 --- Jason End [EMAIL PROTECTED] wrote:
  But how do I populate the array with (for e.g.) 2
  fields from a mysql table. Each line of the select
 box
  needs to hold the Name and Version of the piece of
  software, the results from a:
  select Name, Version from software
  
  -s-
  
  --- Corne' Cornelius [EMAIL PROTECTED] wrote:
   You have to give the Mutli select box a name as
 an
   array. eg:
   
   SELECT NAME=experts[] MULTIPLE SIZE=5
   OPTION VALUE=key1val1/OPTION
   /SELECT
   
   then in PHP, you can access $experts as an
 array.
   
   while (list ($key, $val) = each($experts))  {
  print $key = $valBR\n;
   }
   
   
   Jason End wrote:
   
   I writing a software catalog that features
   experts,
   who a people especially skilled in a piece of
   software. My db, has a software table and an
   experts table. 
   I need to have a page that generates 2 multiple
   select
   boxes, each on with the data from each table. 
   From there one will be able to choose the
 software
   program and the experts, which will then record
 the
   software-expert relationship in the DB. 
   
   The problem is that I don't really understand
 how
   to
   populate multi select boxes with db data, and
 then
   have the selections passed back as inserts. 
   
   Can someone clue me in?
   
   thanks, 
   
   Jay
   
  
 __
   Do you Yahoo!?
   Yahoo! Mail Plus - Powerful. Affordable. Sign
 up
   now.
   http://mailplus.yahoo.com
   
 
   
   
   
   
   
   =Disclaimer and
   Confidentiality===
   This message contains information intended for
 the
   perusal, and/or use (if so stated), by the
 stated
   addressee(s) only. The information is
 confidential
   and privileged. If you are not an intended
   recipient, do not peruse, use, disseminate,
   distribute, copy or in any manner rely upon  he
   information contained in this message (directly
 or
   indirectly). The sender and/or the entity
   represented by the sender shall not be held
   accountable in the event that this prohibition
 is
   disregarded. If you receive this message in
 error,
   notify the sender immediately by e-mail, fax or
   telephone representations contained in this
 message,
   whether express or implied, are those of the
 sender
   only, unless that sender expressly states them
 to be
   the views or representations of 

Re: [PHP-DB] SESSIONS

2003-02-26 Thread MaN
And also use $_POST[SUBMIT] or set register_globals On



 You need to register you varible first with the session

 -Original Message-
 From: David Rice [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 25, 2003 3:10 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] SESSIONS



 Here's something i can't get working it won't go to the last clause of
this
 page i don't think it can set the session variable

 anyone see what im doing wrong? i need more caffeine to get my brain fired
 up today lol..

 ===

 ? session_start();?
 HTML
 head
 /head
 body
 ? if ( !$SUBMIT ){ ?
 form action=? echo $PHP_SELF; ? method=post name=TEST
 input name=name type=text value=name size=20 maxlength=20
 input name=SUBMIT type=submit value=SUBMIT
 /form

 ?
 }
 elseif($SUBMIT){
 $_SESSION[name] = $HTTP_POST_VARS[name];
 ?
 a href=? echo $PHP_SELF; ? next /a
 ?
 }
 elseif( ( $SUBMIT )  (  isset ( $_SESSION[name] ) ) ) {
 echo $_SESSION[name];
 }
 ?
 /body
 /HTML




 _
 Stay in touch with absent friends - get MSN Messenger
 http://messenger.msn.co.uk


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

2003-02-26 Thread mike karthauser
on 26/2/03 12:58 pm, MaN at [EMAIL PROTECTED] wrote:

 And also use $_POST[SUBMIT] or set register_globals On

Just use $_POST[SUBMIT]

register_globals was turned off for security reasons. You are compromising
the security of your system if you turn it back on.
-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email[EMAIL PROTECTED]
Web  http://www.brightstorm.co.uk
Tel  0117 9426653 (office)
   07939 252144 (mobile)

SnailmailUnit 8, 14 King Square,
   Bristol BS2 8JJ


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



[PHP-DB] A-Z Listings

2003-02-26 Thread Andy
Hi There., I have a script that lists directorys then how many files are in each. 
although it won't list in an A-Z format, would anyone know how i would do this?

Any help would  be greatly appreciated and all required code is included below

TIA
Andy

?







function romcount($system, $counter) {







if ($handle = opendir(roms/$system)) {



while (false !== ($file = readdir($handle))) { 



if ($file != .  $file != ..) { 



$counter++;



} 



}



closedir($handle); 



}







}  // end function romcount







function listsystems() {







if ($handle = opendir('roms')) {



while (false !== ($system = readdir($handle))) { 



if ($system != .  $system != ..) { 











// count roms







$counter = 0;



if ($handle2 = opendir(roms/$system)) {



while (false !== ($file = readdir($handle2))) { 



 if ($file != .  $file != ..) { 



$counter++;   



} 



}



closedir($handle2); 



}



$totalroms = $totalroms + $counter;



// end count roms







echo div align=\center\centertable border=\0\ 
cellpadding=\0\ cellspacing=\0\ style=\border-collapse: collapse\ 
bordercolor=\#11\ width=\80%\ id=\AutoNumber1\trtd width=\91%\a 
href=\index.php?page=download2system=$system\$system/a/tdtd 
width=\20%\center($counter)/center/td/tr/table/center/div/center; 



} 



}



closedir($handle); 



echo centerBrbWe Currently Have $totalroms ROMs!/b/centerBR;



}







}  // end function listsystems



?















? 



listsystems(); 



?


[PHP-DB] ODBC Stored Procedure

2003-02-26 Thread Renato Preti
Hi all,

I have a system PHP4+LINUX+DB2. I'm using stored procedure on IBM DB2 7.1,
and in PHP(4.23) I can execute the procedure but I can't get the return
values. Does anyone know why? Below is my source code.

Thank you,

Renato Preti


$result=odbc_prepare($conn,{CALL DSMTD.S6S006(?,?)});
$par[0]=$pim.$num_rand;
$par[1]='
';

if(!odbc_execute($result,$par))
  print(bThe odbc statement failed to execute! /b);

print_r($par);


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



RE: [PHP-DB] RE: PHP4 on Windows using MSSQL

2003-02-26 Thread Ryan Jameson (USA)
I use this combination very successfully. I stick with ODBC for the SQL access though.

 Ryan

-Original Message-
From: Oliver Cronk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 3:23 AM
To: Kevin Gordon
Cc: PHP Mail
Subject: [PHP-DB] RE: PHP4 on Windows  using MSSQL


Sorry made a typo in my last email - I mean't to say wouldn't recommend it
rather than would (in reference to using MSSQL from Linux).

Hope you get the issue sorted

Cheers

Ollie

-Original Message-
From: Kevin Gordon [mailto:[EMAIL PROTECTED]
Sent: 26 February 2003 08:23
To: Oliver Cronk
Cc: PHP Mail
Subject: RE: PHP4 on Windows  using MSSQL


Thanks Ollie. I will check Tcp or Named Pipes.

I have found a Linux Journal article dated 14 Feb 2003 using a FreeTDS
driver and ODBC to MSSQL and will try that.
Cheers,
Kevin

On Tue, 2003-02-25 at 23:25, Oliver Cronk wrote:
 Yes, but I have never personally used Linux to connect to MSSQL so I can't
 really help you on that one.  Although I hear that several people have
done
 this I would really recommend it (as Linux isn't a supported client O/S
for
 MSSQL).  It is *fairly* straightforward on Windows - the hardest bit is
 making sure you have all the correct DLL's in the right places etc etc.

 I use MySQL/ Postgres these days so I can't really remember all the stuff
I
 had to do to get MSSQL working with PHP but I will have a think and let
you
 know if I think of anything that might be useful.

 After having another quick look at your error message at the bottom of
your
 original email it might be worth looking at your MSSQL Server connection
 config dialogs - make sure that TCP/IP has been enabled (looks like you
 might just have named pipes).

 Regards

 Ollie Cronk

 -Original Message-
 From: Kevin Gordon [mailto:[EMAIL PROTECTED]
 Sent: 25 February 2003 08:05
 To: Oliver Cronk
 Cc: PHP Mail
 Subject: RE: PHP4 on Windows  using MSSQL


 Thanks Ollie
 I guess this means using PHP4 MSSQL functions in Windows and PHP4 Sybase
 functions in Linux?


 On Tue, 2003-02-25 at 04:47, Oliver Cronk wrote:
  The MSSQL module for PHP DOES NOT USE ODBC.  It uses the C library
direct
  style of connecting to MSSQL.  Use your enterprise manager to configure
 the
  appropriate users and permissions and you should be fine.
 
  Ollie Cronk
  www.cronky.net
 
  -Original Message-
  From: Kevin Gordon [mailto:[EMAIL PROTECTED]
  Sent: 24 February 2003 07:09
  To: PHP Mail
  Subject: PHP4 on Windows  using MSSQL
 
 
  Hi Everyone,
 
  From a Linux session:
  ~ # telnet 10.1.1.1 1433
  Trying 10.1.1.1...
  Connected to 10.1.1.1.
  Escape character is '^]'.
  Connection closed by foreign host.
 
  From within NT4 Primary Domain Server:
  SQL Server Query Analyzer using the user login  password applied in PHP
  (and created in MSSQL) Queries processed ok.
 
  In PHP must I use NT authenticated login / password?
 
  Both a PHP client on Linux and Windows receive the same error message:
  Warning: SQL error: [Microsoft][ODBC SQL Server Driver][Named
  Pipes]Specified SQL server not found., SQL state 08001 in SQLConnect in
  E:\Inetpub\wwwroot\php\ODBC_Driver.php on line 174
 
  The PHP.ini file on NT4 has:
  **
  [MSSQL]
  ; Allow or prevent persistent links.
  mssql.allow_persistent = On
 
  ; Maximum number of persistent links.  -1 means no limit.
  mssql.max_persistent = -1
 
  ; Maximum number of links (persistent+non persistent).  -1 means no
  limit.
  mssql.max_links = -1
 
  ; Minimum error severity to display.
  mssql.min_error_severity = 10
 
  ; Minimum message severity to display.
  mssql.min_message_severity = 10
 
  ; Compatability mode with old versions of PHP 3.0.
  mssql.compatability_mode = Off
 
  ; Valid range 0 - 2147483647.  Default = 4096.
  ;mssql.textlimit = 4096
 
  ; Valid range 0 - 2147483647.  Default = 4096.
  ;mssql.textsize = 4096
 
  ; Limits the number of records in each batch.  0 = all records in one
  batch.
  ;mssql.batchsize = 0
 
  ; Use NT authentication when connecting to the server
  mssql.secure_connection = Off
 
  ; Specify max number of processes. Default = 25
  ;mssql.max_procs = 25
 
  
  ntwdblib.dll is in the correct Windows directory.
 
  Using a System DNS for ODBC. Should I be using a File DNS?
 
  Can I open up NT4 PDS to telenet to it?
 
  Any thoughts, comments?
  Many thanks,
 
  Kevin Gordon
  New Zealand
 
 
 








-- 
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] Trouble with Joins

2003-02-26 Thread Roland Perez
I have a survey I created that when the formis being filled out it will select
values from list. The list values are other tables in the same DB. When I go
to get the info again I am trying to do a left join of the two table to get the
description instead of the id's associated in the table. 
Since I used one table several time for the values how do I, can I, join that
tabel multiple times on the SELECT statement so I can get each instance of
the description. 
Ex. In the survey I reference the usercomm table 5 times to answer
different questions. Since the answer for each instance could be
different how do I join the usercomm table back to the replies table
several times.

Thanks for any help
Roland Perez
[EMAIL PROTECTED] 

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



[PHP-DB] MD5()

2003-02-26 Thread Chris Payne
Hi there everyone,

I have to store some CC details in a database which are inputted from a form, is MD5() 
the best way to secure the data?  If so, how do I view MD5() data after it has been 
inserted?  Any good MD5() tutorials out there?

Thanks for your help :-)

Regards

Chris

Re: [PHP-DB] MD5()

2003-02-26 Thread Brad Bonkoski
md5() is a one-way encryption algorithm.  So once they are encrypted, you cannot 
decrypt them.  Just look at the md5() function on the php website.  It has what you 
need to do.  Of course if you eventually need these back
in the clear, then md5 would not be a solution.
-Brad

Chris Payne wrote:

 Hi there everyone,

 I have to store some CC details in a database which are inputted from a form, is 
 MD5() the best way to secure the data?  If so, how do I view MD5() data after it has 
 been inserted?  Any good MD5() tutorials out there?

 Thanks for your help :-)

 Regards

 Chris


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



[PHP-DB] Re: Get MySQL table schema for a dump

2003-02-26 Thread Fredrik de Vibe
[EMAIL PROTECTED] (Jonathan Villa) writes:
 Is there was to get a database's table schema?

I don't think it's called schemas in mysql, but I'm not sure :-)

 So far, I have a simple function which will output 
 INSERT INTO table (x,x,x,) VALUES(x,x,x);
 [ ... ]
 but what I'm missing is 
 CREATE table blah, blah, blah

mysqldump is the tool you need.

e.g.
  $ mysqldump -u user [-p] Database  db_dump_file.sql

man mysqldump for more info.


-- 
--Fredrik
If God is dead, who will save the Queen?

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



RE: [PHP-DB] Re: Get MySQL table schema for a dump

2003-02-26 Thread Jonathan Villa
Sorry, I should have explained that I want to do this via PHP.

 
--- Jonathan
 
 
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Fredrik de Vibe
Sent: Wednesday, February 26, 2003 5:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: Get MySQL table schema for a dump

[EMAIL PROTECTED] (Jonathan Villa) writes:
 Is there was to get a database's table schema?

I don't think it's called schemas in mysql, but I'm not sure :-)

 So far, I have a simple function which will output 
 INSERT INTO table (x,x,x,) VALUES(x,x,x);
 [ ... ]
 but what I'm missing is 
 CREATE table blah, blah, blah

mysqldump is the tool you need.

e.g.
  $ mysqldump -u user [-p] Database  db_dump_file.sql

man mysqldump for more info.


-- 
--Fredrik
If God is dead, who will save the Queen?

-- 
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] Parse Error

2003-02-26 Thread Chris Payne
Hi there everyone,

I'm trying to run an if statement and inside that have other if's, but it keeps 
telling me I have a parse error on the first if in the if statement (The second if 
down).  Can anyone see what i'm doing wrong?

if ($packages == 1)(

if ($airporttransfer == car)(
$airporttransfer2 = 12.00);
if ($airporttransfer == bus)(
$airporttransfer2 = 10.00);
if ($airporttransfer == none)(
$airporttransfer2 = 0.00);

);

Thanks for your help :-)

Chris

Re: [PHP-DB] Parse Error

2003-02-26 Thread Micah Stevens
If statements use curly braces. Do this: 


if ($packages == 1){

if ($airporttransfer == car)
$airporttransfer2 = 12.00);
if ($airporttransfer == bus)
$airporttransfer2 = 10.00);
if ($airporttransfer == none)
$airporttransfer2 = 0.00);

}



On Wed, 2003-02-26 at 16:42, Chris Payne wrote:

 Hi there everyone,
 
 I'm trying to run an if statement and inside that have other if's, but it keeps 
 telling me I have a parse error on the first if in the if statement (The second if 
 down).  Can anyone see what i'm doing wrong?
 
 if ($packages == 1)(
 
 if ($airporttransfer == car)(
 $airporttransfer2 = 12.00);
 if ($airporttransfer == bus)(
 $airporttransfer2 = 10.00);
 if ($airporttransfer == none)(
 $airporttransfer2 = 0.00);
 
 );
 
 Thanks for your help :-)
 
 Chris


RE: [PHP-DB] Parse Error

2003-02-26 Thread Peter Lovatt

if ($packages == 1){

if ($airporttransfer == car){
$airporttransfer2 = 12.00};
if ($airporttransfer == bus){
$airporttransfer2 = 10.00};
if ($airporttransfer == none){
$airporttransfer2 = 0.00};

};


() round brackets round the condition {} braces around the 'do it' bit :)

HTH

Peter

-Original Message-
From: Chris Payne [mailto:[EMAIL PROTECTED]
Sent: 27 February 2003 00:43
To: php
Subject: [PHP-DB] Parse Error


Hi there everyone,

I'm trying to run an if statement and inside that have other if's, but it
keeps telling me I have a parse error on the first if in the if statement
(The second if down).  Can anyone see what i'm doing wrong?

if ($packages == 1)(

if ($airporttransfer == car)(
$airporttransfer2 = 12.00);
if ($airporttransfer == bus)(
$airporttransfer2 = 10.00);
if ($airporttransfer == none)(
$airporttransfer2 = 0.00);

);

Thanks for your help :-)

Chris



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



[PHP-DB] If Statement thanks

2003-02-26 Thread Chris Payne
Hi there everyone,

Thank you all for your answer - DOH I can't believe I missed something so simple :-)

Regards

Chris

[PHP-DB] [[PHP-DB] Re: Get MySQL table schema for a dump

2003-02-26 Thread Eric Girard
Jonathan,
You can use Describe TABLENAME as a query and then use that information
to built you create statements.

Eric

Eric Girard
Varsity Crew Team
Computer Science major,
Management Information Systems minor,
Worcester Polytechnic Institute Class of '03

-Original Message-
From: Jonathan Villa [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 6:36 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: Get MySQL table schema for a dump


Sorry, I should have explained that I want to do this via PHP.


--- Jonathan




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Fredrik de Vibe
Sent: Wednesday, February 26, 2003 5:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: Get MySQL table schema for a dump

[EMAIL PROTECTED] (Jonathan Villa) writes:
 Is there was to get a database's table schema?

I don't think it's called schemas in mysql, but I'm not sure :-)

 So far, I have a simple function which will output
 INSERT INTO table (x,x,x,) VALUES(x,x,x);
 [ ... ]
 but what I'm missing is
 CREATE table blah, blah, blah

mysqldump is the tool you need.

e.g.
  $ mysqldump -u user [-p] Database  db_dump_file.sql

man mysqldump for more info.


--
--Fredrik
If God is dead, who will save the Queen?

--
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] MD5()

2003-02-26 Thread John W. Holmes
 I have to store some CC details in a database which are inputted from
a
 form, is MD5() the best way to secure the data?  If so, how do I view
 MD5() data after it has been inserted?  Any good MD5() tutorials out
 there?

Please do your users a favor and do not store credit card numbers on
your system. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP-DB] Get MySQL table schema for a dump

2003-02-26 Thread John W. Holmes
 Is there was to get a database's table schema?
 
 For example, I want to be able to click on a link and then create a
.txt
 file of a table (or even better a databases) schema.
 
 So far, I have a simple function which will output
 
 INSERT INTO table (x,x,x,) VALUES(x,x,x);
 INSERT INTO table (x,x,x,) VALUES(x,x,x);
 INSERT INTO table (x,x,x,) VALUES(x,x,x);
 INSERT INTO table (x,x,x,) VALUES(x,x,x);
 etc.
 
 but what I'm missing is
 
 CREATE table blah, blah, blah
 
 **that is what I want to get.

SHOW CREATE TABLE table_name;

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



[PHP-DB] One more date question (NOOOOOOO) :-)

2003-02-26 Thread Chris Payne
Hi there everyone,

Sorry about all these emails :-)  I have one final question (For this week - LOL).  
How can I get the current month + the next 11 months in a dropdown form box?  Ideally 
there'd be 3 boxes, 1 with the day, dependant on the month you select plus the year, 
though I can hardcode the year without a problem.

Any ideas how I could do this?

Thanks for everything, you are all life savers.  Oh and after thinking about it I 
realized how dumb storing Credit Card details in a DB were :-)

Chris

[PHP-DB] Database Notification

2003-02-26 Thread Aspire Something
Hi all,

Permit me to recive your valuable knowledge ,

We are working on a project where the backend churns data for about 1 Minute (time out 
limit is  2 min) we would like 
to put a page like
 PROCESSING  
during the database is busy doing its fine job. And also a sucess page appears when 
the 
process is sucessfull.

Please if you have any idea how it can be done please let me 
Humble thanks in advance.
 My Sys Looks as ===
RH 7.2  Kernel 2.4.7-10
Apache 1.3.27 ,
PHP 4.3.0 ,
Postgresql 7.3.1 



Regards,
Aspire





Re: [PHP-DB] One more date question (NOOOOOOO) :-)

2003-02-26 Thread Peter Beckman
Sure --

for ($x=0;$x12;$x++) {
  echo 
option.date('F',mktime(0,0,0,(date('n')+$x),date('j'),date('Y')))./option\n;
}

For the day limitation, there are lots of javascripts out there to do that.

Peter

On Thu, 27 Feb 2003, Chris Payne wrote:

 Hi there everyone,

 Sorry about all these emails :-)  I have one final question (For this
 week - LOL).  How can I get the current month + the next 11 months in a
 dropdown form box?  Ideally there'd be 3 boxes, 1 with the day, dependant
 on the month you select plus the year, though I can hardcode the year
 without a problem.

 Any ideas how I could do this?

 Thanks for everything, you are all life savers.  Oh and after thinking
 about it I realized how dumb storing Credit Card details in a DB were :-)

 Chris

---
Peter Beckman  Internet Guy
[EMAIL PROTECTED] http://www.purplecow.com/
---

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



RE: [PHP-DB] Get MySQL table schema for a dump

2003-02-26 Thread Jonathan Villa
Ok, that works great.  Now, what is the best way to echo the result.

For example

$connection = mysql_connect(localhost,u,p);
mysql_select_db(killerspin_com, $connection);
$sql = SHOW CREATE TABLE update_list;
$result_id = mysql_query($sql,$connection);

then what, 

if (mysql_num_rows($res...))
???
or

while ($rows = mysql_fetch_array()...)



 
--- Jonathan
 
 
 
-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 26, 2003 9:49 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Get MySQL table schema for a dump

 Is there was to get a database's table schema?
 
 For example, I want to be able to click on a link and then create a
.txt
 file of a table (or even better a databases) schema.
 
 So far, I have a simple function which will output
 
 INSERT INTO table (x,x,x,) VALUES(x,x,x);
 INSERT INTO table (x,x,x,) VALUES(x,x,x);
 INSERT INTO table (x,x,x,) VALUES(x,x,x);
 INSERT INTO table (x,x,x,) VALUES(x,x,x);
 etc.
 
 but what I'm missing is
 
 CREATE table blah, blah, blah
 
 **that is what I want to get.

SHOW CREATE TABLE table_name;

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/




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



[PHP-DB] help about session

2003-02-26 Thread do khac duy
   i can't start session under incule row
ex: include(file.php);
start_session();

  it say : can't add header header already sent by...v

somebody can help me?



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