[PHP-DB] Using MySQL Inno DB transaction

2005-07-12 Thread Arie Nugraha
Lately i'm building a library automation application with php 5 and MySQL 4..1.

For the transaction module, i'm using Inno DB engine to store the
transaction data, cos i want to use MySQL transaction method which can
be commit or rollback.

But when i tried to rollback the transaction in the other script, the
data still exist in the database.

script1.php :
?php
$mysqli = new mysqli(...);

$mysqli-autocommit(false);
// do the transaction
// and process it in script2.php
?


script2.php
?php
$mysqli-rollback();
?

What's wrong?? does anybody could help me?? Thanks

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



RE: [PHP-DB] Using MySQL Inno DB transaction

2005-07-12 Thread Bastien Koert
I would think that it all has to occur in one script since the db connection 
is closed with an implicit commit when the page ends


bastien


From: Arie Nugraha [EMAIL PROTECTED]
Reply-To: Arie Nugraha [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] Using MySQL Inno DB transaction
Date: Tue, 12 Jul 2005 16:37:56 +0700

Lately i'm building a library automation application with php 5 and MySQL 
4..1.


For the transaction module, i'm using Inno DB engine to store the
transaction data, cos i want to use MySQL transaction method which can
be commit or rollback.

But when i tried to rollback the transaction in the other script, the
data still exist in the database.

script1.php :
?php
$mysqli = new mysqli(...);

$mysqli-autocommit(false);
// do the transaction
// and process it in script2.php
?


script2.php
?php
$mysqli-rollback();
?

What's wrong?? does anybody could help me?? Thanks

--
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] PDF encoded

2005-07-12 Thread Shekhar Juneja
Hi ,
 
I am trying to figure out a way how to display base64 encoded string.
Basically I am getting base64 encoded string back a webservise, I was to
display this PDF inlined in the browser. But instead its printing the
encoded string in the browser.
 
request help on this:)
 
Warm regards
Shekhar
 


RE: [PHP-DB] PDF encoded

2005-07-12 Thread Bastien Koert

http://ca3.php.net/manual/en/function.base64-decode.php

bastien


From: Shekhar Juneja [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] PDF encoded
Date: Tue, 12 Jul 2005 14:30:32 +0100

Hi ,

I am trying to figure out a way how to display base64 encoded string.
Basically I am getting base64 encoded string back a webservise, I was to
display this PDF inlined in the browser. But instead its printing the
encoded string in the browser.

request help on this:)

Warm regards
Shekhar



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



RE: [PHP-DB] PDF encoded

2005-07-12 Thread Shekhar Juneja
Hi Bastien.

Snippet of my code is 

header('Content-type: application/pdf');
header( Content-Disposition: inline);
header('Content-Transfer-Encoding: base64');
echo echo base64_decode€($String);

Where 
$string contains the encoded string.

Don’t know where I am going wrong.

Regards
Shekhar


-Original Message-
From: Bastien Koert [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 12, 2005 3:06 PM
To: [EMAIL PROTECTED]; php-db@lists.php.net
Subject: RE: [PHP-DB] PDF encoded

http://ca3.php.net/manual/en/function.base64-decode.php

bastien

From: Shekhar Juneja [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] PDF encoded
Date: Tue, 12 Jul 2005 14:30:32 +0100

Hi ,

I am trying to figure out a way how to display base64 encoded string.
Basically I am getting base64 encoded string back a webservise, I was 
to display this PDF inlined in the browser. But instead its printing 
the encoded string in the browser.

request help on this:)

Warm regards
Shekhar


--
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] PDF encoded

2005-07-12 Thread Micah Stevens

Looks like you're telling the browser that the data is base64, and then 
decoding the data before you send it.

Try sending the string without the base64_decode() statement. just echo 
$string

Or, lose the transfer encoding header, and leave the base64_decode() in.. 

-Micah 

On Tuesday 12 July 2005 7:56 am, Shekhar Juneja wrote:
 Hi Bastien.

 Snippet of my code is

 header('Content-type: application/pdf');
 header( Content-Disposition: inline);
 header('Content-Transfer-Encoding: base64');
 echo echo base64_decode€($String);

 Where
 $string contains the encoded string.

 Don’t know where I am going wrong.

 Regards
 Shekhar


 -Original Message-
 From: Bastien Koert [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 12, 2005 3:06 PM
 To: [EMAIL PROTECTED]; php-db@lists.php.net
 Subject: RE: [PHP-DB] PDF encoded

 http://ca3.php.net/manual/en/function.base64-decode.php

 bastien

 From: Shekhar Juneja [EMAIL PROTECTED]
 To: php-db@lists.php.net
 Subject: [PHP-DB] PDF encoded
 Date: Tue, 12 Jul 2005 14:30:32 +0100
 
 Hi ,
 
 I am trying to figure out a way how to display base64 encoded string.
 Basically I am getting base64 encoded string back a webservise, I was
 to display this PDF inlined in the browser. But instead its printing
 the encoded string in the browser.
 
 request help on this:)
 
 Warm regards
 Shekhar

 --
 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] PHP Bug handling Messages from MSSQL ?

2005-07-12 Thread Frank M. Kromann
Hi Denio,

The function name should say it all, mssql_get_last_message() returns the
last and only the last message from the server. I'll add an item on my
todo list to implement a mssql_get_server_messages() function tal will
allow you to get all messages from the previous mssql_query() call. This
will only be available in PHP 5 as PHP 4 is closed for new features.

- Frank

 Hello,
 
 I'm trying to build a demo of SQL Injection (SI) to discuss with my
 students. The idea is to use the live demo to show and discuss how to
 avoid SI using some secure code  techiques.
 
 I'm using PHP 4.3.11 and MSSQL 80 on a windows XP box. 
 
 Sometimes a multiline query is submitted to the server, something like
this:
 
 use sales; select name from users; drop table xxx;
 
 
 Note the query above has in fact three queries, each one producing a
 message but the function mssql_get_last_message() aparently doesn't
 return all of them to the user.
 
 Capturing the packets during the connection (e.g ethereal or tcpdump)
 I can perfectly see all messages returning from the server, like this:
 ---
 (1) Changed database context to 'sales'
 (2) result set here
 (3) Cannot drop the table 'xxx', because it does not exist in the
 system catalog.
 
 
 But only the first message is returned from PHP
mssql_get_last_message().
 
 Can anyone help me to explain this behavior ?
 
 Thanks in advance.
 
 
 Denio.
 
 ...
 Denio Mariz
 Teacher, CEFETPB
 Researcher, GPRT/UFPE, Brazil
 
 --
 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] PDF encoded

2005-07-12 Thread Shekhar Juneja
Tried both ways :(
 

-Original Message-
From: Micah Stevens [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 12, 2005 5:17 PM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] PDF encoded


Looks like you're telling the browser that the data is base64, and then 
decoding the data before you send it.

Try sending the string without the base64_decode() statement. just echo $string

Or, lose the transfer encoding header, and leave the base64_decode() in.. 

-Micah 

On Tuesday 12 July 2005 7:56 am, Shekhar Juneja wrote:
 Hi Bastien.

 Snippet of my code is

 header('Content-type: application/pdf'); header( Content-Disposition: 
 inline);
 header('Content-Transfer-Encoding: base64'); echo echo 
 base64_decode€($String);

 Where
 $string contains the encoded string.

 Don’t know where I am going wrong.

 Regards
 Shekhar


 -Original Message-
 From: Bastien Koert [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 12, 2005 3:06 PM
 To: [EMAIL PROTECTED]; php-db@lists.php.net
 Subject: RE: [PHP-DB] PDF encoded

 http://ca3.php.net/manual/en/function.base64-decode.php

 bastien

 From: Shekhar Juneja [EMAIL PROTECTED]
 To: php-db@lists.php.net
 Subject: [PHP-DB] PDF encoded
 Date: Tue, 12 Jul 2005 14:30:32 +0100
 
 Hi ,
 
 I am trying to figure out a way how to display base64 encoded string.
 Basically I am getting base64 encoded string back a webservise, I was 
 to display this PDF inlined in the browser. But instead its printing 
 the encoded string in the browser.
 
 request help on this:)
 
 Warm regards
 Shekhar

 --
 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] PDF encoded

2005-07-12 Thread Micah Stevens

I didn't really read your post carefully. On second read it looks like you're 
trying inlide embedding? So in other words, you want an HTML page with an are 
that is a PDF, as if you used an embed tag? 

If that's what you're trying, it's really flaky, and you'd be better off to 
save it as a .pdf file, and use the embed tag, IMHO..

-Micah 

On Tuesday 12 July 2005 9:39 am, Shekhar Juneja wrote:
 Tried both ways :(


 -Original Message-
 From: Micah Stevens [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 12, 2005 5:17 PM
 To: php-db@lists.php.net
 Subject: Re: [PHP-DB] PDF encoded


 Looks like you're telling the browser that the data is base64, and then
 decoding the data before you send it.

 Try sending the string without the base64_decode() statement. just echo
 $string

 Or, lose the transfer encoding header, and leave the base64_decode() in..

 -Micah

 On Tuesday 12 July 2005 7:56 am, Shekhar Juneja wrote:
  Hi Bastien.
 
  Snippet of my code is
 
  header('Content-type: application/pdf'); header( Content-Disposition:
  inline);
  header('Content-Transfer-Encoding: base64'); echo echo
  base64_decode€($String);
 
  Where
  $string contains the encoded string.
 
  Don’t know where I am going wrong.
 
  Regards
  Shekhar
 
 
  -Original Message-
  From: Bastien Koert [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, July 12, 2005 3:06 PM
  To: [EMAIL PROTECTED]; php-db@lists.php.net
  Subject: RE: [PHP-DB] PDF encoded
 
  http://ca3.php.net/manual/en/function.base64-decode.php
 
  bastien
 
  From: Shekhar Juneja [EMAIL PROTECTED]
  To: php-db@lists.php.net
  Subject: [PHP-DB] PDF encoded
  Date: Tue, 12 Jul 2005 14:30:32 +0100
  
  Hi ,
  
  I am trying to figure out a way how to display base64 encoded string.
  Basically I am getting base64 encoded string back a webservise, I was
  to display this PDF inlined in the browser. But instead its printing
  the encoded string in the browser.
  
  request help on this:)
  
  Warm regards
  Shekhar
 
  --
  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] PDO name

2005-07-12 Thread Kevin Schmeichel
 
 Anyone know why the name PDO was chosen for what is really just a SQL 
abstraction layer?  I actually implemented something a while back that I 
called PDO, which provided a means to do get/set/save/delete etc. operations, 
on data objects, but the persistent implementation was hidden from the 
application programmer, similar to JDO.

  It seems like PDO is a misnomer, and there is a need for a real PDO 
framework...

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



[PHP-DB] Creating an Interbase.so file

2005-07-12 Thread Todd Cary
I am running Fedora Core 3 and I want to install and integrate Interbase 
(Firebird 1.5) with php.  To create the so file, I downloaded php 
4.4.0 and did a


./configure --with-interbase=shared,/opt/firebird
make

Then I place the interbase.so into /usr/lib/php4 and make an 
interbase.ini in /etc/php.d to load the interbase.so.


When I do a restart of httpd, I get this error:

PHP Warning:  Unknown(): Unable to load dynamic library
'/usr/lib/php4/interbase.so' - /usr/lib/php4/interbase.so: failed to map
segment from shared object: Permission denied in Unknown on line 0

Any suggestions?

Todd

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



[PHP-DB] Searchable/Sortable Database Fields with MySQL/PHP

2005-07-12 Thread Matt McNeil
Greetings,
I need to securely store lots of sensitive contact information and
notes in a (MySQL or other freely available) database that will be
stored on a database server which I do not have direct access to. 
This database will be accessed by a PHP application that I am
developing.  However, I also need to be able to search/sort these data
with the database functions (SELECT, ORDER BY, etc) so simple PASSWORD
style encryption of specific fields would not work.  (For example, I
need to encrypt
contacts' names, but need to be able to sort results by name). (I
realize I could load the entire table into memory with PHP and
process/search/sort it there, but
that's obviously not a very good solution).  Ideally I would like to
encrypt entire tables.  An encrypted file system is not really an
option, because the goal is to prevent loss if the database server is
hacked (in addition, I wouldn't be able to install an encrypted file
system on the database server).

My sense is that this is a difficult problem.  However, I made the
mistake of promising this functionality, 
so I'm scrambling to figure out some kind of solution.  Any
suggestions?

Thanks so much!

Matt

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



Re: [PHP-DB] Searchable/Sortable Database Fields with MySQL/PHP

2005-07-12 Thread Micah Stevens

Just do all your searching/sorting in PHP.. it would be slower, and if your 
dataset is very large (sounds like it might be the case) it would be 
impossible.. So that might be out of the question.. 

A bit of system engineering might find a solution too, consider which fields 
you need to search/sort by, and by possibly limiting those somewhat to just 
what is absolutely necessary, you might be able to get by not encrypting 
those columns.

Another idea would be to provide hinting columns, essentially providing just 
enough data in those columns to be able to sort with, but not enough to give 
away the data. i.e. just the first 2 characters of each name. 

This would allow you to search and get a smaller dataset from the database, 
something you could decrypt in php, and then search further, possibly making 
it manageable. 

Hope that helps,
-Micah 


On Tuesday 12 July 2005 2:36 pm, Matt McNeil wrote:
 Greetings,
 I need to securely store lots of sensitive contact information and
 notes in a (MySQL or other freely available) database that will be
 stored on a database server which I do not have direct access to.
 This database will be accessed by a PHP application that I am
 developing.  However, I also need to be able to search/sort these data
 with the database functions (SELECT, ORDER BY, etc) so simple PASSWORD
 style encryption of specific fields would not work.  (For example, I
 need to encrypt
 contacts' names, but need to be able to sort results by name). (I
 realize I could load the entire table into memory with PHP and
 process/search/sort it there, but
 that's obviously not a very good solution).  Ideally I would like to
 encrypt entire tables.  An encrypted file system is not really an
 option, because the goal is to prevent loss if the database server is
 hacked (in addition, I wouldn't be able to install an encrypted file
 system on the database server).

 My sense is that this is a difficult problem.  However, I made the
 mistake of promising this functionality,
 so I'm scrambling to figure out some kind of solution.  Any
 suggestions?

 Thanks so much!

 Matt

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



Re: [PHP-DB] Searchable/Sortable Database Fields with MySQL/PHP

2005-07-12 Thread Micah Stevens

Oh! Also, there's built in mysql functions for encryption, I forgot about 
that, so you can still search, like this:

insert into table set name_field = AES_ENCRYPT('Some name', 'secret key');
select * from table where AES_DECRYPT(name_field,'secret key') LIKE '%some';

Make sense? You'll want an SSL connection to the database of course, and 
anyone that has any decent access to the server memory would be able to get 
the encryption key, but if you're careful it would work.

-Micah 

On Tuesday 12 July 2005 2:53 pm, Micah Stevens wrote:
 Just do all your searching/sorting in PHP.. it would be slower, and if your
 dataset is very large (sounds like it might be the case) it would be
 impossible.. So that might be out of the question..

 A bit of system engineering might find a solution too, consider which
 fields you need to search/sort by, and by possibly limiting those somewhat
 to just what is absolutely necessary, you might be able to get by not
 encrypting those columns.

 Another idea would be to provide hinting columns, essentially providing
 just enough data in those columns to be able to sort with, but not enough
 to give away the data. i.e. just the first 2 characters of each name.

 This would allow you to search and get a smaller dataset from the database,
 something you could decrypt in php, and then search further, possibly
 making it manageable.

 Hope that helps,
 -Micah

 On Tuesday 12 July 2005 2:36 pm, Matt McNeil wrote:
  Greetings,
  I need to securely store lots of sensitive contact information and
  notes in a (MySQL or other freely available) database that will be
  stored on a database server which I do not have direct access to.
  This database will be accessed by a PHP application that I am
  developing.  However, I also need to be able to search/sort these data
  with the database functions (SELECT, ORDER BY, etc) so simple PASSWORD
  style encryption of specific fields would not work.  (For example, I
  need to encrypt
  contacts' names, but need to be able to sort results by name). (I
  realize I could load the entire table into memory with PHP and
  process/search/sort it there, but
  that's obviously not a very good solution).  Ideally I would like to
  encrypt entire tables.  An encrypted file system is not really an
  option, because the goal is to prevent loss if the database server is
  hacked (in addition, I wouldn't be able to install an encrypted file
  system on the database server).
 
  My sense is that this is a difficult problem.  However, I made the
  mistake of promising this functionality,
  so I'm scrambling to figure out some kind of solution.  Any
  suggestions?
 
  Thanks so much!
 
  Matt

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