Re: [PHP-DB] Re: CHAR field with charset UTF8 and COLLATION UNICODE_CI_AI or UTF8PHP is loading white spaces

2016-11-22 Thread Lester Caine
On 22/11/16 18:01, Delmar Wichnieski wrote:
> 2016-11-22 12:42 GMT-02:00 Lester Caine <les...@lsces.co.uk>:
> 
>> >  needs help to move
>> > the string to a variable that it can check if the UTF8 data is a single
>> > character or multiple characters.
>> >
>> >
> I believe it is a single byte, the goal is to simulate a boolean field,
> where I only use S for yes and N for no. (Idem/the same Y and N in English).
> 
> There is no operations like 'upper' and 'lower'. The script is very simple,
> according to pastebin links in the previous message.
> 
> S and N are in the range between 0 and 127 of the ASCII table and UTF-8
> says that only one byte is required to encode the first 128 ASCII
> characters (Unicode U +  to U + 007F).
> 
> But even if it consumed 2, 3 or 4 bytes, UNICODE should predict the end of
> the character, so it would be enough to find the end, apply the inverse
> algorithm to the encoding of the code point, and we would have the
> character back. This is just a dream.
> 
> 
> If the situation presented along the thread is a problem, then more people
> should report it. Let's wait. I'll use trim per hour, or cast
> 
> example
> 
> $q = $pdoconn->prepare("SELECT CODIGO, CAST(ACESSOSISTEMA AS VARCHAR(1)) AS
> ACESSOSISTEMA FROM USUARIO");
> 
> And the problem is solved. Or yet another solution not thought out.

That is perhaps the point. PHP on it's own can't decide if you need to
convert to an ASCII single byte, allow space for a multiple byte single
character or something else. All PHP sees is a buffer with a number of
bytes in, and what comes over the wire from Firebird even strips any
trailing space characters requiring the client end to untangle things.
If you want a unicode string you have to copy it to a mbstring variable
since the simple single byte buffer does not know that it is not just
256 bit data. Now a CHAR(1) could be treated as a special case, but
CHAR(2+) can not be so easily handled. This is one reason why the normal
'hack' to add a binary domain is to use a SMALLINT rather than a CHAR
and store NULL/0/1 ...

I'm not saying that the current results are correct, just that without a
native handling of unicode one has some edge cases which could be
resolved different ways. Returning a unicode CHAR field as a fixed
number of 32bit characters has an attraction when one needs to work with
particular fixed character positions in the string but while UNICODE_FSS
was designed with that in mind, UTF8 *IS* the right way forward once
everybody actually supports it ;)

One of my pet grips is that simple PHP variables do not play well with
database fields, and rather than having to pull in mbstring, extending
'string' so that it can be flagged as utf8 and handle a utf8 field
natively is what is needed. The fact that Firebird is capable of using a
different collation for each field is not something that PHP understands
and another reason I don't use PDO at all in production. With ADOdb one
has a bit more access to the metadata for the query.

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Re: CHAR field with charset UTF8 and COLLATION UNICODE_CI_AI or UTF8PHP is loading white spaces

2016-11-22 Thread Lester Caine
On 22/11/16 13:56, Delmar Wichnieski wrote:
> But VARCHAR fields work correctly. Problem only in CHAR.

VARCHAR is trimmed to the number of bytes used ... not the number of
'characters'! CHAR is only designed for single byte characters IN PHP so
providing multi byte characters to a CHAR(1) field does not know how
many actual characters are displayed. I'm not saying what is currently
happening is right, but it is 'safe' since PHP then needs help to move
the string to a variable that it can check if the UTF8 data is a single
character or multiple characters.

> And it should not be gambol, because
> "Each UTF is reversible, thus every UTF supports lossless round tripping:
> mapping from any Unicode coded character sequence S to a sequence of bytes
> and back will produce S again."
> Source
> http://unicode.org/faq/utf_bom.html

Provided that there is no processing of the data then that is correct,
but operations like 'upper' and 'lower' can result in a change in number
of characters, and the addition of accent characters can also result in
differences. It is this area that basically stopped the development of a
UTF8 native PHP6. Normalization in http://www.unicode.org/reports/tr15/
is a minefield even for the Firebird collation process ... Just how long
is the normalized string?

> 2016-11-22 11:21 GMT-02:00 Lester Caine <les...@lsces.co.uk>:
> 
>> > On 22/11/16 12:58, Delmar Wichnieski wrote:
>>> > > Since there was no answer here on the list, I was feeling alone and
>> > afraid
>>> > > and wondering why no one else has this problem.
>> >
>> > Delmar I must apologise as I HAD posted a reply, but it did not actually
>> > go through ... list in bounce emails mode which I missed ...
>> >
>> > The simple answer is that strings in PHP are not UTF8 so the 'bug' you
>> > are listing is actually that we need to make sure that the single byte
>> > buffer for a string is long enough. To ensure UTF8 strings to be handled
>> > properly since PHP6 is not going to happen, we have to transfer the
>> > simple php strings to mbstring objects. UTF8 is a gambol in PHP if it is
>> > going to be transferred properly as a simple string variable and will
>> > give string length as bytes rather than characters ...


-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Re: CHAR field with charset UTF8 and COLLATION UNICODE_CI_AI or UTF8PHP is loading white spaces

2016-11-22 Thread Lester Caine
On 22/11/16 12:58, Delmar Wichnieski wrote:
> Since there was no answer here on the list, I was feeling alone and afraid
> and wondering why no one else has this problem.

Delmar I must apologise as I HAD posted a reply, but it did not actually
go through ... list in bounce emails mode which I missed ...

The simple answer is that strings in PHP are not UTF8 so the 'bug' you
are listing is actually that we need to make sure that the single byte
buffer for a string is long enough. To ensure UTF8 strings to be handled
properly since PHP6 is not going to happen, we have to transfer the
simple php strings to mbstring objects. UTF8 is a gambol in PHP if it is
going to be transferred properly as a simple string variable and will
give string length as bytes rather than characters ...

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread Lester Caine
On 20/09/16 09:19, Karl DeSaulniers wrote:
> The command line I am using is as follows.
> 
> /usr/bin/php5 /home/(directory name removed)/auto_reminder.php

Which runs when entered on YOUR command line, but fails in the cron job?
Something in auto_reminder.php needs replacing with the 'full' text as
it is getting information from the local user settings.

> The time stamps (minute, hour, day, etc) that precede the /usr are loaded by 
> my host. just fyi.

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread Lester Caine
On 20/09/16 09:14, Karl DeSaulniers wrote:
> Pardon my ignorance, but what do you mean full path?
Full path to php application.
Cron jobs run as 'root' and so need and user account settings added
manually if they do not match the 'root' environment.

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Cron job anomaly

2016-09-20 Thread Lester Caine
On 20/09/16 09:10, Karl DeSaulniers wrote:
> Hi Lester,
> They are listed inside the php file.
> 
> The error message I get is:
> 
> Access denied for user '(user name removed)'@'%' to database '(database name 
> removed)'
> 
> Thanks for your response.

Need a mysql guy to deal with that ;)
I have seen it myself when trying to use mysql and it's to do with the
'network path' but I'm on firebird which simply uses the
'(user name removed)'

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread Lester Caine
On 20/09/16 06:16, Karl DeSaulniers wrote:
> Was probably a newb question, however, now it is saying that my database user 
> is not allowed access.
> I have a mysql connection inside my script that reads the database to get 
> user email addresses to send a reminder email to.
> 
> Is there supposed to be a call or directive to load mysql in my command line 
> as well?
> Man this is frustrating.

The user name and password you are using from the web scripts SHOULD
work in the script you are using on the cron job. Although mysql does
seem to have a few extra security features that cut in. Are they listed
in the script, or loaded from the environment ... which is of cause
different for the cron jobs ... and why you needed the full path.

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Connecting to database fails

2016-08-13 Thread Lester Caine
On 14/08/16 00:00, Rich Shepard wrote:
>   Ah, yes. Pat likes MySQL/MariaDB so he does not build php to support
> postgres. I'll rebuild it and that should solve the problem.

I've been with Firebird/Interbase since before PHP existed ;)

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Connecting to database fails

2016-08-13 Thread Lester Caine
On 13/08/16 21:23, Rich Shepard wrote:
> With no other PHP applications installed here I have no experience in
> determining where this stoppage occurs. Pointers on how to isolate the
> source of the problem, than how to fix it, are needed.

Do you actually have the postgresql PHP driver installed. Database
drivers are not installed by default as you only really need the ones
you are actually using.

Should be php5-pgsql

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] PDO and SAP HANA prepared statements issue

2016-01-26 Thread Lester Caine
On 26/01/16 13:10, Alko Kotalko wrote:
> ODBC commands actually work with the ? and colon ($) notations. But not
> with colon (:). I suppose this is due to the lack of named parameters
> support in ODBC commands (haven't actually confirmed that though). The $
> notation brings me the closest to named parameters because a specific
> number can be repeated.

This is the key to your problem ...

The PDO generic process does not support named parameters directly, so
the ? format duplicating the multiple use of a named parameter is
required ... if the driver actually supports that?

Does your setup work if the SQL is

$stmt = $dbh->prepare("SELECT * FROM dummy WHERE col1=? AND col2=? AND
col3=?");
$stmt->bindParam(1, $S1);
$stmt->bindParam(2, $S2);
$stmt->bindParam(3, $S1);

On some drivers the named parameters have to be converted to '?' format,
but I can't find the notes now on what combination works and what does't :(

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] PDO and SAP HANA prepared statements issue

2016-01-26 Thread Lester Caine
On 26/01/16 19:06, Alko Kotalko wrote:
> I've tried all the notations with PDO as well and none of them work with
> SAP HANA. It works with MySQL though. So I presume that there is either a
> bug in PDO driver or there is some mismatch between PDO and SAP HANA.

Firebird does not support named parameters so we stick with ?
parameters. Not sure on SAP HANA, but a quick google gives
"The SAP HANA JDBC driver doesn't support named parameters" and I would
anticipate that the ODBC driver probably has the same problem, but the
simpler ordered array of parameters should work ...

There WAS a document about just what combinations HAVE been tested and
worked, but I'm not even sure now where it as created :(

>From the generic ODBC driver -
http://php.net/manual/en/function.odbc-prepare.php ...
Some databases (such as IBM DB2, MS SQL Server, and Oracle) support
stored procedures that accept parameters of type IN, INOUT, and OUT as
defined by the ODBC specification. However, the Unified ODBC driver
currently only supports parameters of type IN to stored procedures.

It is some time since I used the ODBC interface, but I think PDO_odbc
still uses the generic ODBC inerface and this does have it's own
restrictons based on what platform you are using. It may be worth trying
the generic ODBC interface and see if this works any differently. The
ODBC driver uses the same style of working as the Firebird/Interbase
driver for binding variables and that does work.

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



[PHP-DB] SQL injection

2015-06-21 Thread Lester Caine
OK - this had no chance of success since publish_date_desc is processed
using the _desc ( or _asc ) and any invalid data stripped

sort_mode=publish_date_desc%20or%20(1,2)=(select*from(select%20name_const(CHAR(111,108,111,108,111,115,104,101,114),1),name_const(CHAR(111,108,111,108,111,115,104,101,114),1))a)%20--%20and%201%3D1

The question is more of interest in just what it was trying to achieve?
I presume hack MySQL? So Firebird would barf anyway, but just trying to
something that has generated some several hundred error log entries in
the last two days ...

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] SQL injection

2015-06-21 Thread Lester Caine
On 21/06/15 20:14, Mark Murphy wrote:
 But what does your application do when it gets an invalid SQL statement?
 Maybe it is telling the attacker something important about your database so
 that they can compromise it with the appropriate injection.

It just defaults to the first news article in this case ... and counts
it as another hit on that article. We have never allowed free text SQL
to be included in any query, and any variable passed via the URL to
provide navigation is only ever passed as a parameter, so even if there
was no filtering of the parameter it would just fail. I'd only expect a
continued 'attack' if the URL was returning something useful so to carry
on just did not make sense ...

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] SQL injection

2015-06-21 Thread Lester Caine
On 21/06/15 18:55, Richard wrote:
 OK - this had no chance of success since publish_date_desc is
  processed using the _desc ( or _asc ) and any invalid data
  stripped
  
  
  sort_mode=publish_date_desc%20or%20(1,2)=(select*from(select%20n
  ame_const(CHAR(111,108,111,108,111,115,104,101,114),1),name_const
  (CHAR(111,108,111,108,111,115,104,101,114),1))a)%20--%20and%201%3
  D1
  
  The question is more of interest in just what it was trying to
  achieve? I presume hack MySQL? So Firebird would barf anyway, but
  just trying to something that has generated some several hundred
  error log entries in the last two days ...
  
  Lester Caine - G8HFL
  
  
  The sub-query is invalid, if valid it would've been equivalent to:
  or (1,2)=(select*from(select 'b2xvbG9zaGVy' as 1, 'b2xvbG9zaGVy'
  as 1))a) -- and 1=1
  
  Seems non threatening to me.
 Regardless of whether this specific attack could have resulted in
 harmful sql injection or not, user input should be sanitized so that
 things never get this far.

? That is taken direct off the URL! Sod all I can do to prevent it, but
I was simply asking if I was missing something as it did not make any
sense? It got no further than the error log but as I said several
hundred attempts via a few different filter options all of which
suggested something that was expected to work if the site was a
vulnerable mysql powered site ... which it's not.

Seems that is just a pointless URL rather than some recently identified
potential vulnerability?

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] SQL Injection

2015-05-16 Thread Lester Caine
On 16/05/15 10:00, Karl DeSaulniers wrote:
 That does clarify things a bit better on both the @ question
 and prepared statements. Thank you for the link as well.
 
 So new question.. what is the best type of database to use
 for someone who wants to start small and grow big?
 
 My findings led me to MySQL InnoDB.

I'm somewhat biased since much of my data goes back to a time before
MySQL even existed. Using Interbase which is now open source as
Firebird. Early versions of MySQL were never stable enough to use in the
environments I work, and while Postgres was also appearing on the radar,
I've no reason to change. Little things like being able to run backups
automatically even if I've never actually had to use one. And some SQL
functions available in Firebird have yet to appear in other engines, and
having to decide if you want the security InnoDB provides is simply
standard in other engines.

The first question is are you hosting yourself or using third party
hosting? MySQL tends to be available on all third party posting, with
some providing Postgres, while Firebird tends to be privately hosted. If
you are hosting yourself, then of cause MySQL may actually be MariaDB
and you end up with a mix of sources. It's a bit like Internbase and
Firebird where the commercial charges can affect one installation where
the other is totally free.

If you are only looking for a single installation, then MySQL is
probably fine. I'm running 50+ databases and with Firebird each is
isolated in it's own directory and automatically backs up to the website
storage area.

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] SQL Injection

2015-05-16 Thread Lester Caine
On 16/05/15 14:51, Karl DeSaulniers wrote:
 Interesting. I program in MySQL on a hosting plan by a third party.
 I have heard/read MySQL is not an enterprise solution, but 
 for the basic business with say less than 100,000 customers,
 it does the job and well. Larger than that I had hear Postgres
 and oracle were good to look at. Havent heard any good things about
 SQL server (.NET), but did't have too much trouble working with one a few 
 years back.
 I guess I don't know enough about what is available to do with a good 
 database and which
 to pick to do what I want with. There are so many. Hence my question here.

That probably sums up 'hosted' plans. The number of available database
engines has declined in recent years, and where a site 'outgrows' MySQL,
there are a few custom developments, but bottom line ... there is not a
single obvious answer ;)

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] SQL Injection

2015-05-16 Thread Lester Caine
On 15/05/15 06:21, Karl DeSaulniers wrote:
 Oh ok. Now it makes a little more sense. 
 I have worked in ASP before, but I am programming in PHP and MySQL at the 
 moment. 
 
 I am going to look into Prepared Statements. Thanks for your feedback.

Just to clarify things a little here and explain
http://php.net/manual/en/pdo.prepared-statements.php a little more ...

Many of the legacy injection problems where/are caused by building up
the query as a fully self contained string. Various methods like
'magic_quotes' and wrapping $var in things like makesafe($var) were the
only way some database engines could handle adding variables to the SQL
string and much code still follows that style even today. Other database
engines have always had the ability to pass the variables as a separate
array of data, and the @x is more normally seen as a simple ? in the SQL
string, so PDO and other frameworks map the ':var' elements of the first
example to the relevant style used by the database. Actually naming
parameters is not the norm, so one has to have the right number of '?'
elements to go with the array of data passed, so PDO is adding a layer
of code which hides the underlying execute(sql_query, array_of_data);

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



[PHP-DB] SQL injection attempt

2015-03-11 Thread Lester Caine
Been a while since I've had a concerted hacker attempt, but over night
this has appeared in the logs.

'sort_mode' = 'last_modified_desc\' and(/**/sElEcT 1
/**/fRoM(/**/sElEcT count(*),/**/cOnCaT((/**/sElEcT(/**/sElEcT
/**/uNhEx(/**/hEx(/**/cOnCaT(0x217e21,0x4142433134355a5136324457514146504f4959434644,0x217e21
/**/fRoM information_schema./**/tAbLeS /**/lImIt 0,1),floor(rand(0)*2))x
/**/fRoM information_schema./**/tAbLeS /**/gRoUp/**/bY x)a)

Does not get anywhere since 'sort_mode' gets filtered in this case to
LAST_MODIFIED DESC and the trash gets ignored. Presume this is some
MySQL hack attempt ( bit lost on Firebird anyway ;) ) but the question
as usual is it malicious in the content of MySQL, or just fishing?

In my case it just white screens anyway so I don't know why they keep
trying to send the same style of url thousands of times?

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] MySQLi

2014-09-14 Thread Lester Caine
On 14/09/14 04:57, Karl DeSaulniers wrote:
 Awesome, thanks for the link. I know even less about PDO then I do regular 
 MySQL however.
 I am hoping MySQLi isn't too far off a shoot. Just need to sit down with it 
 all and figure out a path.

PDO is still a bit of a grey area. It was intended to make changes
between database engines more transparent, and MySQL to MySQLi is
essentially just a different front end both targeting MySQL. The problem
is that it only ever did half the job, trying to make the data returned
'transparent' while ignoring the SQL. Aziz's approach is one way of
going, but just like the e_strict problems with PHP itself, it's the
subtle changes to the language used which cause problems when
'translating' from one to the other. It will depend on the style of
MySQL you are using currently as to how easy it is to 'translate'. My
own database is Firebird which has SQL functions that have yet to appear
in MySQL, some of those are exposed in MySQLi so you can ignore them
when upgrading but it is always those fringe cases that take the most
time to resolve? :(

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] MySQLi

2014-09-13 Thread Lester Caine
On 13/09/14 11:40, Karl DeSaulniers wrote:
 Hope this message finds you well. Quick question about MySQLi and PHP.
 I have a website that was built back in 2012 that is still on PHP 5.2 and 
 MySQL 
 and I am wanting to update it to PHP 5.7 with MySQLi without headaches.
 I am dreading this like a spoonful of molasses. Is there any sugar remedy for 
 this medicine 
 or do I just grow a pair and take it?

Well a few problems 5ere ...
PHP5.2 had already been shelved at end of 2010, but I know why it was
probably used 2 years later. I'm STILL running 5.2 on servers as the
time needed to convert those sites is just not available and can't be
justified cost wise :(

 Any MySQL = MySQLi converters out there?
 Any PHP5.2 = PHP 5.7 cheat sheets?
 
 If I update my server to PHP 5.7 is everything going to break? Or stupid 
 question of course it is?
PHP5.7 will not be around any time soon, PHP5.6 has just been released.
But converting from 5.2 all the way to 5.6 is not something that is easy
to do. I'm still only moving 5.2 to 5.4 at presnt.

http://php.net/manual/en/migration53.php and
http://php.net/manual/en/migration54.php is the starting point, but
things depricated in 5.3 were removed in 5.4 so if you are using any of
those methods then they need removing. You can switch the later PHP
servers to ignore e_strict warning/errors, but this is the major problem
area. and really the only way to move forward is clear all of those
problems before moving forward. Unless you caa ensure your server will
always be switched bak to a compatible mode of working.

And all that before even looking at MySQL ... I've never used it, so
hopefully someone else will cover that side.

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Query does not work

2014-07-02 Thread Lester Caine
On 02/07/14 04:43, Ethan Rosenberg, PhD wrote:
 while ($row31 = mysqli_fetch_row($result31)) {
   printf (%s %s %s %s %s\n, $row31[0], $row31[1], $row31[2], $row31[3]);

Try
print_r( $row31 );

 } // no output
 
 How can I loose a db connection in the middle of a program?
This is not showing that you have, only that you can't see the actual
data returned.

I prefer firebird to mysql, and the normal process is to use the
mysqli_fetch_assoc style working so that the keys of the array are the
returned field names in which case the print_r output gives more
information ...

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Re: Newbie Question $2

2014-06-17 Thread Lester Caine
On 17/06/14 15:04, Jim Giner wrote:
 We're all so eager to help out poor Ethan (who many of you know is NOT a
 newbie) but nowhere does Ethan say what difficulty he is having.
 
 The suggestions made so far are great but what are we solving?
I see you have spotted the original question :)
The original post was fairly complete in what it was asking, and the
answers reasonably worded ...

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Workout Schedule Calendar

2014-03-01 Thread Lester Caine

Vinay Kannan wrote:

I am getting stuck at the DB structuring part for this.
1) I can have all the different types of workouts entered into the DB with
the number of days / sessions thats included in a particular package.
2) and then when a member pays the fees eg: for 3 months (12 sessions) so
have 12 entries made into the DB and then map with the members attendance
and what he has done on that day.

But was wondering if this is an efficient way to do it, over a period of
time, there would be 1000s of members, who would be going to the gym for
decent period of time.
so eg: 1000 member attend the gym for 1 year (365), that makes the total
entries in the DB to be 1000s x 365 just for a year!


With a relational database anything is possible ( you don't say which one but 
that really only affects fine detail and bells and whistles ).


You are going to have a table with members, one record for each. These will have 
the basics like when their next payment is due, or how many sessions per week ...


I would also imagine a database of 'facilities' a bit like room booking so you 
don't perhaps have more members booked in than you can cope with? In the absence 
of that you would at least have list of available activities?


A client visit would then be a combination of pre-booked or 'open' activities. 
So a table with a list of date/time/member_id/activity.


History would be a matter of just how long you want to maintain the information. 
My own systems manage activities relating to callers visiting an office, and we 
maintain history back many years, but if a 'caller(member)' has not been 
attending in the previous 2 years then their history is deleted. Actually it 
will still be maintained in backup files, but that is not directly accessible. 
Legally, the 'Data protection Act' comes into play here in the UK, but we have 
sites with over a million visits recorded over the past approaching 20 years, 
and the system still works as fast as when it was first installed :)


( I use Firebird but any of the options will handle your level of activity )

--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Billing Module in PHP

2014-01-09 Thread Lester Caine

Vinay Kannan wrote:

Currently the DB structure stores the following : 1) Customer details. 2)
Membership ID and the payment paid at the time of signing up (I am thinking
i might not need the signing up amount to be stored in the customer DB in
the first place, and have them seperate in a table called signinupfeespaid
or something like) 3) And maybe have another table called
'memberfeesintervals) which will have (membershipid,
paymentinterval,nextdueon) and then pick up the pending fees (Customer can
also issue part payments) from a pendingfees table

Any suggestion is welcome! Thank You in advance!


Personally I'd have a table for payments received since you will have many 
payments per MembershipId over time, but I'd probably keep the 'nextdue' and 
'period' fields as part of a single customer detail table. There should only be 
one answer for 'nextdue' based on the last payment which will show the period 
paid for, and even this is a little redundant since it is available from the 
last payment record, but I see no need for a third table? Just set the right 
'relations' between the master record and payment list?


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Re: mysql query

2013-08-23 Thread Lester Caine

Ethan Rosenberg wrote:

I'm probably wrong, but in some contexts; eg, sql query, $ signs are not used.
I tried and added the incorrect $ sign, and Netbeans did not complain.  If
anyone knows of an editor that will able to spot this kind of error, please
inform the list.


You do need to take a little more care when using variables IN strings and watch 
that they are highlighted. As you say, the parsing is not actually wrong as it 
is valid 'text' and adding SQL parsers for every database is not really 
practical and probably would not fix the problem anyway? Personally I use 
Firebird, and have always built the SQL using parameters, so that the SQL is 
pure text, and values are passed in an array. This is something MySQL was a lot 
later in catching onto, but many of the simple security problems are totally 
eliminated using that approach.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Bluefish for PHP

2013-08-23 Thread Lester Caine

Ethan Rosenberg wrote:

Dear List -

How do I configure Bluefish for PHP?  I am running version 2.2.4 of Bluefish.


I'd forgotten about bluefish. You should not need to do anything. PHP files are 
just processed as PHP? But it's more an HTML editor and geared to producing and 
verifying HTML so not as good when editing code. My Eclipse setup does a very 
similar job on the html/js and css so I've not used it in many years. I don't 
think the colour selections were very good if memory serves.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Bluefish for PHP

2013-08-23 Thread Lester Caine

Michael Oki wrote:

Install Komodo IDE or Adobe Dreamweaver. They'll highlight errors and warnings.

Last time I looked neither were free?

Eclipse has served me well for many years and while it has it's problems often 
someone comes up with a new plugin to sort it. My problem is dealing with the 
errors and warnings in the third party libraries - it flags them as well :)


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Re: mysql query

2013-08-23 Thread Lester Caine

Karl DeSaulniers wrote:

If your on a PC I would just get Eclipse. But if you have netbeans, you can set 
the syntax highlighting for the different scripts you write in the preferences. 
PHP, java, javascript, etc...


But the problem tha5 has been identified will never be flagged by simple 
highlighting. Debugging complex SQL queries is possibly better done outside of 
the PHP pages. Not sure exactly what SQL plug-in I've got running on Eclipse at 
the moment, but as Ethan identified earlier, the SQL script ran from the command 
line. It was passing the variables into it which was wrong.


I'm with him on the statement that MySQL should have returned an error. 
Certainly Firebird would have done and so identifying the problem might have 
been easier.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Subject Matter

2013-08-23 Thread Lester Caine

Matt Pelmear wrote:

I am not sure who runs the list, whether they care about off-topic posts,
or whether anyone else cares about it.


The php lists are only loosely moderated, but comments like yours usually bring 
things under control. I'd refer you to my recent post thought as to why the 
current threads are not that far off topic ;)


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Subject Matter

2013-08-23 Thread Lester Caine

Matt Pelmear wrote:

On 08/23/2013 04:36 PM, Lester Caine wrote:

Matt Pelmear wrote:

I am not sure who runs the list, whether they care about off-topic posts,
or whether anyone else cares about it.


The php lists are only loosely moderated, but comments like yours usually
bring things under control. I'd refer you to my recent post thought as to why
the current threads are not that far off topic ;)



Indeed, that thread is one that is on topic... but I think the signal-to-noise
ratio on this list is rather poor ;)
If I'm the only one bothered by it, it's no big deal for me to unsubscribe... I
just thought I'd check the general opinion first.
I don't run into these problems on the internals list... :-)


In reality there are probably too many lists and none are policed particularly 
well. My email setup strips each to it's own folder so I can simply ignore 
things if I want, but occasionally something pops up which needs redirecting. We 
have a firebird php list which handles the firebird and interbase drivers so 
those sort of enquiries get redirected. But I must have a clean out some time. 
The first message on this list is 1999 ... and I have some older lists still 
archived :)


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Re: mysql query

2013-08-22 Thread Lester Caine

Vinay Kannan wrote:

Jim, I know this is a stupid question to be asking this far into PHP
Development, maybe was a bit lazy, or just got too used to Notepad++, which
editor for PHP are you using? The feature which you mentioned for a good
php editor, sounds exciting, offcourse i would be looking only at the free
ones


There are a number of options for highlighting and error checking just about 
every language. Running Linux most of them are free ;)
gedit and kwrite highlight automatically and help identify problems. In the past 
I've been running on both linux and windows so something cross platform was 
essential, and it's still nice when I do have to worry about windows sites. 
Eclipse provides that base, and while PDT is the official plugin for PHP, I'm 
back on the older PHPEclipse as it fits much better with the way I work. With 
properly commented libraries it provides pop-up crib sheets onthe parameters for 
a selected function, and of cause the auto complete can be configured to match 
your preferred way of working ... I'm still on tabs for indenting


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Firebird return wrong value

2013-01-18 Thread Lester Caine

vbe...@mail.com wrote:

result:
Array ( [0] = Array ( [COST] = -0.00 ) )


As a starting point ... can you look at the database using Flamerobin and check 
what it shows has been stored. I don't see anything wrong with what you have 
done except that 'cost' should perhaps be -1.0, so once we know what IS in the 
database we can look at which end has gone wrong ;)


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Firebird return wrong value

2013-01-18 Thread Lester Caine

Matijn Woudt wrote:

Dear List!

i have a strange problem.

I have a Firebird database (dialect 3). Firebird server: 2.0.6
I create a table, and insert a row like that:
CREATE TABLE PRICE (
   ID INTEGER NOT NULL,
   NAME VARCHAR(10),
   COST NUMERIC(15, 2));

INSERT INTO PRICE (ID, NAME, COST)


You should not use double quotes around column names. Try to use backtick
operator instead:
INSERT INTO `PRICE` (`ID`, `NAME`, `COST`)
Don't know if that solves the problem, but it's atleast good practice.
Second, do you really need firebird database?
It's pretty outdated database, and there are much better alternatives.


Matijn ... All totally incorrect information for a REAL SQL database. Backticks 
are a bodge for MySQL only and not part of the SQL standard.


And Firebird is used for many systems worldwide and is a much better alternative 
to many later database engines. Many Oracle users are porting over to Firebird 
to reduce costs.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Firebird return wrong value

2013-01-18 Thread Lester Caine

Berko Bubu wrote:

INSERT INTO PRICE (ID, NAME, COST)



You should not use double quotes around column names. Try to use backtick
operator instead:
INSERT INTO `PRICE` (`ID`, `NAME`, `COST`)
Don't know if that solves the problem, but it's atleast good practice.
Second, do you really need firebird database?
It's pretty outdated database, and there are much better alternatives.

It's an existing system, so i can't change it.
I have tried with firebird 2.5 and same result.

The value stored right. I have seen it in FlameRobin, ISQL, etc
And when i use native native lib (ibase_connect,ibase_prepare,ibase_execute) i 
get right value.
Maybe is it a bug in pdo_firebird driver ?


This is possible ...
Have you tried the other options to PDO::FETCH_ASSOC ?

I've not bothered with the PDO drivers as the Firebird one can't cope with 
two-phase commits cross database, and I know that others have found the 
restrictions imposed by PDO prevent things working well in older style Firebird 
Applications.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP-DB] Another PDO ?

2012-09-10 Thread Lester Caine

Jim Giner wrote:

On 9/10/2012 10:49 AM, Bastien Koert wrote:

On Mon, Sep 10, 2012 at 9:48 AM, Jim Giner jim.gi...@albanyhandball.com wrote:

Reading up on the pdostatement class.  Wondering what the intent of the
columnCount function is.  I mean, aren't the number of columns in a result
known when you write the query?  Granted, you might have some very complex
query that you may not know the number, but for most queries you will know
the columns you are expecting.  So - what am I not seeing?

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



It might be for those cases where you run a select * from ...


But - again - one already knows how many fields are in that table when one
writes the query...


You do not necessarily KNOW how many fields. You know how many fields should be 
in the version of the database you are coding for, so any difference would flag 
a problem. Also you may not ACTUALLY have the schema for a database in which 
case a count of the fields found is useful for further processing those fields.


Another area is when you are working with fabricated joined queries where 
duplicate field names between tables will give a reduced number of final fields 
in the result.


Of cause it IS often better to work with named fields rather than using '*' 
which does allow better handing of the process anyway.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk



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



Re: [PHP-DB] PDO user question

2012-09-09 Thread Lester Caine

Michael Stowe wrote:

How are you using the number?  Probably the easiest way is to utilize 
PDOStatement::FetchAll() and then do a count() on that result set.


There are two things to bear in mind here. Often you are only displaying a 
subset of records - ten per page perhaps - and so a count of the total helps to 
populate the navigation tools. COUNT(*) is not the most efficient way of doing 
that when dealing with large numbers of records, and so keeping a table with a 
set of counters that are populated via triggers on insert and delete help to 
speed up that process. FetchAll() should then always produce a full set of 
records except for the last page ...


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk



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



[PHP-DB] Nubbie pointers on MySQL users ...

2012-08-21 Thread Lester Caine

OK

I've had a crash course in MySQL and have moved some joomla sites over to one of 
my servers. I've got phpmyadmin up and running and can see one of the remote 
servers, and I have a mirror running on a local server, but I'm a little 
confused over 'user names'


The local machine (php5.3) worked quite happily with user@localhost, but when I 
tried the same setup on the second machine (php5.4) while I could get into the 
server with 'localhost' in order to get PHP connecting I ended up with a 
combination of the domain name 'medw.org.uk' and the local machine name 'rdm2' 
with the same user names. Where am I going wrong? Is there something I'm missing 
setup wise?


( And I don't know who you manage with raw SQL for transfers, on Firebird I can 
backup and restore a 500Mb database in seconds ;) )


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk


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



Re: [PHP-DB] php adodb book suggestins

2012-01-27 Thread Lester Caine

David McGlone wrote:

I started with PHP just before PHP5 was finally released, so never used PHP4,
  and found ADOdb very early on so have never used anything else. One gets 
stuck
  in one's way when something simply works ... Probably why I'm finding PDO 
such a
  backwards step having been spoilt by the transparent cross db support ADOdb
  provides. I only use Firebird in production, but pulling stuff from other 
data
  sources is a doddle nowadays.

Sadly this is true. quite a few times already I've thought about just
going back to PEAR. It doesn't have much to do with the code itself,
it's more of that at home feel.

I also have these thoughts that if PEAR went belly up, so could ADOdb.
Scary thought indeed. :-/


I do my own mods to ADOdb ;) So it does not bother me, certainly a LOT less than 
having to cope with all the 'improvements' in PHP itself!


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] php adodb book suggestins

2012-01-26 Thread Lester Caine

David McGlone wrote:

On Thu, 2012-01-26 at 08:45 +, Lester Caine wrote:

  David McGlone wrote:

can anyone suggest any good up to date books out there on php   adodb.

  The only documentation on ADOdb is the website
  http://adodb.sourceforge.net/#docs  ... has ANYBODY seen it described in a 
php book?
  While I have bought a couple of php books, the on-line material is always 
more
  up to date and asking often fills in gaps that one had not even thought of.


Thanks Lester. I've been playing around with it a lot, but haven't got
as comfortable with is as I was with PEAR. :-/


I started with PHP just before PHP5 was finally released, so never used PHP4, 
and found ADOdb very early on so have never used anything else. One gets stuck 
in one's way when something simply works ... Probably why I'm finding PDO such a 
backwards step having been spoilt by the transparent cross db support ADOdb 
provides. I only use Firebird in production, but pulling stuff from other data 
sources is a doddle nowadays.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] isError ADODB

2012-01-05 Thread Lester Caine

David McGlone wrote:

I am not ADO savvy, but the error message you got is the same as what
  I get in MySQL.
  On this line, try..

  If($this-isError($this-db))


if( $this-db-isError() )

BUT
if( !$this-db ) { not connected } is the more normal first check


  Hoping that fixes it for you.
  Best,

Thanks Karl. I finally got to try this and it wasn't the answer. I'll
keep plugging to see what I can do.



--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Abstraction library

2011-12-30 Thread Lester Caine

David McGlone wrote:

Hi everyone I got a quick question. I'm wondering if anyone is using a
DB abstraction layer such as PEAR DB. I've used PEAR DB in the past and
knew it's been on it's way to extinction, but never looked into
alternatives or any other way to replace it. Now this has come back to
bite me in the rear and I don't know what to do. Is PEAR useful anymore
at this point? Am I better off just writing my own? I hate the thought
of having to change my habits I've had for so long, but I guess that's
how it has to be. Maybe I should have rolled my own in the first place
and I wouldn't have had to rely on something that's not guaranteed :-/


Pear DB was superseded by MDB2 http://pear.php.net/package/MDB2 but that has not 
been updated in the last year.
PDO is a half way house to an abstraction layer and while it is having minor bug 
fixes, it is not really abstraction layer, only a different way of interfacing 
to the drivers. It does nothing for
I'm still using ADOdb http://adodb.sourceforge.net/ which I've had no problems 
with in the last 10 years and on the whole transparently switches between 
databases ( including PDO drivers if you want ;) ). It even includes it's own 
cache which can help with repetitive stuff. It is still actively supported, and 
is used by a number of large projects.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Abstraction library

2011-12-30 Thread Lester Caine

David McGlone wrote:

On Fri, 2011-12-30 at 11:23 -0500, David McGlone wrote:

  On Fri, 2011-12-30 at 12:27 +, Lester Caine wrote:

David McGlone wrote:

  Hi everyone I got a quick question. I'm wondering if anyone is using a
  DB abstraction layer such as PEAR DB. I've used PEAR DB in the past and
  knew it's been on it's way to extinction, but never looked into
  alternatives or any other way to replace it. Now this has come back to
  bite me in the rear and I don't know what to do. Is PEAR useful anymore
  at this point? Am I better off just writing my own? I hate the thought
  of having to change my habits I've had for so long, but I guess that's
  how it has to be. Maybe I should have rolled my own in the first place
  and I wouldn't have had to rely on something that's not guaranteed :-/

  
Pear DB was superseded by MDB2http://pear.php.net/package/MDB2  but that 
has not
been updated in the last year.
PDO is a half way house to an abstraction layer and while it is having 
minor bug
fixes, it is not really abstraction layer, only a different way of 
interfacing
to the drivers. It does nothing for
I'm still using ADOdbhttp://adodb.sourceforge.net/  which I've had no 
problems
with in the last 10 years and on the whole transparently switches between
databases ( including PDO drivers if you want;)  ). It even includes it's 
own
cache which can help with repetitive stuff. It is still actively 
supported, and
is used by a number of large projects.


  Lester, that sounds good. By any chance would you know how much they
  differ and the learning curve between the two?

I forgot to add that I took a look at some examples and it looks almost
exactly like PEAR. I'm more less worrying about anything drastic I may
run into once I've gotten so far into the project. I'm afraid it would
be a big setback.


I've switched a few projects from an assortment of styles ( including PDO ) TO 
use ADOdb instead with little trouble. bitweaver uses a slim wrapper around 
ADOdb, which can be switched to using PEAR instead, and this works well, so I 
would not expect much trouble migrating over. Simple wrappers like GetOne() tidy 
a number of areas and it makes database access easy.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Fatal Error - Undefined function mysqli_connect

2011-09-04 Thread Lester Caine

Ben wrote:

My server was upgraded to PHP 5.3.8 and MySQL 5.1.58 today and, since, I am
getting a 500 error on any script requiring a DB connection.

Upgraded from what?
Sounds like the mysqli extension is no longer getting loaded. There will either 
be an error saying why, or it is still commented out in the php.ini.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Fatal Error - Undefined function mysqli_connect

2011-09-04 Thread Lester Caine

Ben wrote:

Upgraded from what?
  Sounds like the mysqli extension is no longer getting loaded. There will

either be an error saying why, or it is still commented out in the php.ini.

Upgraded from PHP 4.3 and MySQL 4.1.  Was using mysql_connect, but
understand that mysqli is better/supported extension for newer versions, so
am trying to rewrite the code to use mysqli_connect.  For what it's worth,
mysqli_init() also produces Call to undefined function mysqli_init() in my
error logs.


That would explain the problem ;)
Need the mysqli extension enabled instead of mysql ...

--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Oracle NClobs

2011-08-05 Thread Lester Caine

n.a.mor...@brighton.ac.uk wrote:

Can anyone help please?  I am using Oracle 10g (10.2.0.3) with PHP 5.2.5.
It may not be related, but there were a number of issues with BLOB ids in 
Firebird which were not fixed until 5.2.7, I don't have anything that old 
running now, but I think that it was not only Firebird that was affected by the 
problem.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Listing parent ids

2011-07-28 Thread Lester Caine

Arno Kuhl wrote:

I'm currently using MySQL but I'll switch databases if there's a compelling
reason and no drawbacks.
Thanks for the lead, I'm googling recursive queries.


'common table expression' is the thing to google for, but MSDN seem to have 
hijacked all the top spots.
http://syntaxhelp.com/SQLServer/Recursive_CTE is a nice example of what you 
outlined ...


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] php_interbase.dll , PHP 5.3.x VC9 needed, which works with Embarcadero Interbase

2011-05-31 Thread Lester Caine

Shahriyar Imanov wrote:

Hey guys,

I wonder if anyone can help me to find php_interbase.dll file for PHP
5.3.x [VC9], which works with Embarcadero Interbase. I tried those
which come with PHP distribution: apparently they all work with
Firebird only. When I tried them, they say I don't have
username/password set for Firebird server.

Til now, I have been using VC6 version of PHP 5.3.1 and had DLL file
of 2008, VC6 build. I had no problem. Today I upgraded to PHP 5.3.6
VC9, and can't find working DLL file.

Any assistance would be greatly appreciated.


OK current situation is that the latest VC9 builds of PHP do now include 
php_interbase. So downloading the current one (?5.3.6) will give you the extension.
Using Apache, we now use the VC9 builds of that from apachelounge rather than 
the VC6 builds, and this sorts out that difference.


As for actually working WITH Interbase ... not sure who is actually testing 
that, on the whole we have all moved over to Firebird so that we do not have any 
licensing problems.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



[PHP-DB] Re: [PHP-WIN] Re: PHP Search DB Table

2010-12-14 Thread Lester Caine

Oliver Kennedy wrote:

$query = SELECT * FROM clients WHERE clientid = '%.$term%';


$query = SELECT * FROM clients WHERE clientid = '%.$term.%';
Note missing '.'
But that should be the same as
$query = SELECT * FROM clients WHERE clientid LIKE '.$term.';

--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Re: ezmlm warning

2010-11-05 Thread Lester Caine

Karl DeSaulniers wrote:

Hi, Can anyone admin please explain this to me?


If the email server gets bounce messages back for emails set out, then it tries 
to check those emails. If the warning message gets through then nothing really 
happens, but if that bounces as well, then it will disable sending more emails 
to that address.

I had one for this list this morning as well ...

--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Upgrading PHP Version 5.1.6

2010-03-05 Thread Lester Caine

Vinay Kannan wrote:

Hello,

I am currently using  php version 5.1.6 and now m thinking of upgrading, i
got php installed long time back using WAMP, i wanted to know if theres an
easy way to upgrade directly, without having to remove this version, i also
have a good number of databases, and it would be a pain, if i am required to
uninstall the current version of wamp and then reinstall the newer version.


There is no problem installing a new copy of PHP into it's own directory, and 
then changing your Apache httpd.conf to point to the new copy. Nothing else is 
affected by this, and it should be possible to switch between versions of PHP 
simply by restoring the old copy of httpd.conf.


The only thing to watch out for is where your php.ini file is being stored. 
httpd.conf an supply a location for this, but many WAMP setups simply use a copy 
in the c:\windows directory. If this is the case, then it is worth adding a 
PHPINIDir to the new httpd.conf pointing to a copy of php.ini in your new copy 
of PHP.


http://php.net/manual/en/install.windows.apache2.php

--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?

2009-12-10 Thread Lester Caine

Sara Leavitt wrote:

Hi,

We are about to convert all of our queries using mysql_pconnect to
prepared statements using PDO database connections.  It will take some
time to convert the hundreds of SQL statements so the plan is to do it
in phases.  Is it a bad idea to have both a mysql_pconnect and a PDO
connection open for the same application?  Will this doubling of our
database connections for every page hit degrade performance?   Any tips
on the best way to transition to PDO/prepared statements with minimal
disruption?


One thing to be careful is if you are relying on 'transactions' to handle 
anything. Obviously the transaction has to be in the same connection just to 
work. Despite what others have said, the PDO connection will be different to the 
generic mysql connection as it is a separate process. Persistent connections 
will only reuse an already open connection, you can't connect two processes to 
the same connection. You would not know which process was accessing things.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?

2009-12-10 Thread Lester Caine

Sara Leavitt wrote:

Hi Lester,

Our application is not using php transactions (e.g., COMMIT, ROLLBACK 
etc.), so I think we are safe there.  Are you saying that even if both 
the mysql_pconnect  and PDO connection are persistent that they will be 
completely separate?  (Havn't had a chance to test this empirically just 
yet.)


Yes ... I'm not totally sure about how MySQL works by default, but having 
'committed' data on one connection, one would need to refresh the other 
connection possibly to see that data. Firebird is a lot more manageable on 
transaction control, and basically data entered on on connection will not be 
visible on the other until properly committed. Having that activity hidden in 
the drivers can lead to a little 'confusion' as to what state data is actually 
in 


Even just opening two connections via the MySQL driver will have the same 
effect.

--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?

2009-12-10 Thread Lester Caine

Sara Leavitt wrote:
So I can see that using two connections for updating might get out of 
synch; however, mixing the connections should be OK for a series of 
SELECT queries on the read-only side of the application, right?


Yes  - if you are only reading already stored data there should not be a 
problem.


-Sara

Lester Caine wrote:

Sara Leavitt wrote:

Hi Lester,

Our application is not using php transactions (e.g., COMMIT, ROLLBACK 
etc.), so I think we are safe there.  Are you saying that even if 
both the mysql_pconnect  and PDO connection are persistent that they 
will be completely separate?  (Havn't had a chance to test this 
empirically just yet.)


Yes ... I'm not totally sure about how MySQL works by default, but 
having 'committed' data on one connection, one would need to refresh 
the other connection possibly to see that data. Firebird is a lot more 
manageable on transaction control, and basically data entered on on 
connection will not be visible on the other until properly committed. 
Having that activity hidden in the drivers can lead to a little 
'confusion' as to what state data is actually in 


Even just opening two connections via the MySQL driver will have the 
same effect.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] PDO and PostgreSQL - RAISE NOTICE

2009-10-05 Thread Lester Caine

Samuel ROZE wrote:
Hi, 
Thanks for your reply.


In fact, my request returns a result which i get with the fetch method.
But, it must returns other informations, which are not in the result...
This informations are neturned before the result in console...

So, i don't know how I can get that.


PDO does not support many of the 'additional' features that databases 
provide. It's designed to provide a 'lowest common denominator' solution 
JUST for the data. If you are NOT planning to use any other database 
then you may well find that the native postgres driver will provide 
these additional facilities.


I use Firebird myself so can't comment on the 'fine detail' on postgres, 
but some of the Firebird options can't easily be supported in PDO ;)


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Need help in PHP file Management System

2009-09-21 Thread Lester Caine

nagendra prasad wrote:

Eric, I am new to file or content management. So, if possible can you send
me few scripts or some links from where I can learn more about it?


Have a look at bitweaver ... http://bitweaver.org
What this does is creates a set of directories for storage, and under 
that one directory for each user, and stores all their files within 
their own base folder.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] PgSql PDO

2009-09-11 Thread Lester Caine

kranthi wrote:

I am not able to get this working...
1. pdo_pgsql.so exists in the extensions directory and is referenced
in the ini file.
2. phpinfo() shows that support for both pgsql and pdo_pgsql is enabled.
3. PDO::getAvailableDrivers() lists pgsql as avilable driver.
4. I am able to connect via pgsql_connect()

pdo_pgsql::_construct() is throwing an PDO_Exception could not find driver

am I missing something here ? pls help


Perhaps you could show the code. You should be using =new rather than 
_construct() I think.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Strange string from MEMO field in FireBird

2008-12-13 Thread Lester Caine

Kamil Walas wrote:

Hi,

I new in PHP. I work with FireBird and I have query looks:
select Y.Organizm as Nazwa, count(Y.ID) as LiczbaPrzypadkow, 
count(Y.Organizm) as DodatnichPrzypadkow, count(distinct Y.Pacjent) as 
LiczbaPacjentow, count(distinct Y.DodatniPacjent) as DodatnichPacjentow 
, list(distinct Y.DodatnieZlecenie) as DodatnieZlecenia from 
SelRaportIdentyfikacji('2008-11-01', '2008-11-30') Y left outer join 
Materialy M on M.ID = Y.Material left outer join Oddzialy O on O.ID = 
Y.Oddzial group by 1 order by 3 desc, 1


and the result is something like that:
http://img509.imageshack.us/img509/5066/78994034sy1.jpg

when I double-click on the MEMO field I get window with ID:
http://img300.imageshack.us/img300/623/79032822pi4.jpg

it looks that everything is OK.

But when I write in php  echo $row['DODATNIEZLECENIA'] I got values like:
0x000c, 0x0019, 0x0014, itp..

var_dump($row) gives:
array(8) { [NAZWA]=  string(16) Escherichia coli 
[LICZBAPRZYPADKOW]=  int(42) [DODATNICHPRZYPADKOW]=  int(42) 
[LICZBAPACJENTOW]=  int(41) [DODATNICHPACJENTOW]=  int(41) 
[DODATNIEZLECENIA]=  string(18) 0x000c 
[NAZWAGRUPY1]=  string(14) (nieokreślony) [NAZWAGRUPY2]= 
string(14) (nieokreślony) }


I don't know what I'm doing wrong. Why php didn't write correctly 
exactly this one field? Any help will be aprrecieated.


You do not say which version of PHP. There was a problem with versions
of PHP5 from 5.2.0 to 5.2 5 which return the BLOB ID incorrectly. 5.2.6
should be OK. Also you do not say how you are creating the results.
Which functions you are using.

There is a support list for Firebird and PHP
http://groups.yahoo.com/group/firebird-php/ which also has useful
messages in the archive.

--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php


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



Re: [PHP-DB] When does using multiple tables make sense?

2008-10-26 Thread Lester Caine

Liam Friel wrote:

2008/10/20 Lester Caine [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]

Jason Pruim wrote:

So my question is... When is it best to use more tables? All the
info will be related to each other, so I think I would be
looking at either a many-to-many relationship, or a many-to-one
relationship (still figuring that out).


One thing that I've realised make sense is to have a 'sub-table' for
things like phone number, email, fax and the like. All too often we
have two phone numbers or different email addresses, so a four field
table with
ID number, type of info, info, note
This way one can add as many info fields of any different type to a
client/contact record. The type of info field flags things like
primary phone.
Address details often need the same treatment as well, but I use UK
post code as a key for the bulk of that information so it just goes
into a another info field.


I usually like to think of multiple tables in terms of - how many of 
this type of data will the users need?  If it is a set number i.e. users 
should only have name then I would put it in a customer table.  If this 
type of data may have many entries i.e. user uploaded images (they can 
have any number), then I would use a different table to store the images 
or information along with a reference to which user they belong.


This practice stops redundant data and using uneccessary space in your 
database being used.  For example: if you wanted to have 10 fields for 
user images and you put them in the contact table, users that do not use 
the 10 image fields will be wasting space. whereas if they are in a 
related seperate table, only space is used for images that have been 
uploaded.  Using PHP you would do the necessary validation to check the 
number of images etc a user was allowed.


so in short - if a type of data you are inputting has an unknown number 
of results - it is best to put it in another table: it is also known as 
normalisation.


I think that is more or less what I said ;)
One of my areas of interest is genealogical data, and there can be several 
areas where some 'individual' records have no data and others can have a large 
number. Even 'date of birth' may be something that is not a simple date ;)


Almost as soon as you put a field in the main index table, there will be an 
exception to the rule :)


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] When does using multiple tables make sense?

2008-10-20 Thread Lester Caine

Jason Pruim wrote:
So my question is... When is it best to use more tables? All the info 
will be related to each other, so I think I would be looking at either a 
many-to-many relationship, or a many-to-one relationship (still figuring 
that out).


One thing that I've realised make sense is to have a 'sub-table' for things 
like phone number, email, fax and the like. All too often we have two phone 
numbers or different email addresses, so a four field table with

ID number, type of info, info, note
This way one can add as many info fields of any different type to a 
client/contact record. The type of info field flags things like primary phone.
Address details often need the same treatment as well, but I use UK post code 
as a key for the bulk of that information so it just goes into a another info 
field.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Performance (lots of tables / databases...)

2008-09-27 Thread Lester Caine

danaketh wrote:

Hi,

   the first choice is probably the best for you. When you think about 
second solution, it will be a nightmare when you have 1000+ databases 
and have to administrate them from one central system (if you're about 
to do it like this). The third solution looks little complicated to me - 
have one DB for comments, one for items etc.


   But you can do it also in one database and six tables. Make one table 
'blogs' where the blogs names and ids will be stored. Then you can just 
add one more field 'blog_id' to every table and identify items, 
categories, whatever on this. However in your situation (1000+ blogs) it 
may be not the best solution.


That alternate option is the easiest to manage, but since you make no mention 
of WHICH database engine which is best would be affected by that choice. And 
how you are hosting the site(s) may also limit your options. Properly indexed 
tables will be fast and a single connection accessing that data will be faster 
than having to make multiple connections to different databases, and if it 
only has to manage a small number of table most links would probably be cached.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] databases and XML

2008-09-09 Thread Lester Caine

Yves Sucaet wrote:

Hi List,

I was wondering what strategies people are using to handle large volumes of XML 
data:

How do you store the data? e.g.: Text-files, databases (which one)...?
How big are your datasets? e.g.: MB, GB, TB...?
What do you use to query the data? e.g.: PHP w/ text-files, SQLServer with for 
xml clause...?

Finally, what limitations do you experience currently when handling XML?


Take a look at openstreetmap.org
http://wiki.openstreetmap.org/index.php/Planet is several GB of XML data.
The only way of handling it to use it IS via a database, and it has scripts to 
dump it to various databases.

So what large volume are you thinking about?

--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] australian city db -lat/lon?

2007-08-15 Thread Lester Caine

Bastien Koert wrote:

http://www1.auspost.com.au/postcodes/


The Australian postcode table does not have lat and lon - at least not on the 
copy I have, am I missing something?


--
Lester Caine - G8HFL
-
Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://home.lsces.co.uk
MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP-DB] Php 5 and Mysql on Windows

2006-10-04 Thread Lester Caine

[EMAIL PROTECTED] wrote:


That solved it. Awesome. Thanks you so much.


Brian - A 'phpinfo()' test page is almost essential. When you make 
changes to the php.ini file you can check they have taken ;)


--
Lester Caine - G8HFL
-
L.S.Caine Electronic Services - http://home.lsces.co.uk
Model Engineers Digital Workshop - 
http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/

Treasurer - Firebird Foundation Inc. - http://www.firebirdsql.org/index.php

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



[PHP-DB] Re: adodb is slow

2005-06-06 Thread Lester Caine

Oriol wrote:


I'm proud to install adodb library in my framework. I succesfully got it.
But, surprise! My scripts became slower than ever! Exactly the 33% of the
time is spent by adodb
So, I know the advantages of this library, and I understand the reason is so
slow...but, well, I wondered if somebody has reached a better results with
adodb doing something with the library in performance.
Well, thanks in advance.


As has already been said - abstraction layer will be slower.
One thing that is nice about ADOdb is the accelerator. Which does reduce 
the overhead

http://adodb.sourceforge.net/
Look for
Speed Up Your PHP Code with the ADOdb extension

--
Lester Caine
-
L.S.Caine Electronic Services

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



Re: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread Lester Caine
Martin Norland wrote:
Hatem wrote:
Fetching 10 rows is much faster than 1000 ! Fourat
your code is optimized just keep it as it :) just keep
your code away from adodb, pear db, and such
abstraction if you want speed ! you don't need to talk
about optimisation with 2 queries.
Regards,
Hatem
Depends on the DB, in many cases the times are so similar as to not be 
worthwhile - but yes, I agree - limits are definitely worthwhile.
Don't know what you are using ;)
Transferring 1000 records is always going to take time, when you only 
need 10 to be displayed.

Run the query without the limit, this gives you the count - don't 
actually fetch the rows.  Now run the same query, with the limit.  If 
your database is worth anything (most any is), it has this query cached 
and it takes negligible extra time, and you don't have to spend time 
'skipping' ahead X rows.  If your database interface functions support 
'skipping' ahead - use that instead.
The trick with any transactional database is to maintain the most used 
counts in a second table, and manage those counts with triggers, so you 
only need a single record read to access them. The counts will always be 
valid for your view of the database then.

Obviously, for page 1 of a paginated list, this performs worse than just 
running the single query.  But if you get to page 99, you'll likely find 
this is faster.  Feel free to do your own tests, many factors can change 
all of these findings, and it's best to match them to suit your own 
scenario.
The ADOdb pager only needs to know how many pages to indicate in the 
navigate bar, and how many records to download. In theory this can be 
very fast, and only slows down where a database engine does not support 
a simple limited read. pgsql driver in ADOdb supports LIMIT so it's only 
the calculation of COUNT(*) that needs replacing with a faster 
pre-calculated count.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] accessing mysql on non default port - windows

2005-02-05 Thread Lester Caine
Jeff wrote:
thats no good.  man if its something simple, i'm not seeing it.
well it was something simple...and now i see it.  old_passwords.
Don't you just love informative error messages ;)
--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Integrating Interbase.so and PHP

2005-01-15 Thread Lester Caine
Todd Cary wrote:
 I have compiled interbase.so, but even though I have
extension=interbase.so
in the php.ini file, it is not part of PHP.  Has anyone had success 
doing this?
Try asking on the firebird-php list
http://groups.yahoo.com/group/firebird-php
There are various notes on different distributions in the archive, a 
starting point would be which distribution, and PHP4 or 5

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: PHP and Firebird

2004-12-01 Thread Lester Caine
Anatol - you seem to be mixing up PHP with Firebird internal UDF, the 
two have nothing in common.

FIRST. Can you actually access Firebird from PHP ( forget UDF totally at 
this stage ).

PHP on Linux needs installing with php_ibase.so in order to access the 
ibase_/fbird_ functions.

Once you have Firebird installed and running then you could look at 
adding UDF's, but they have nothing to do with PHP, and need to be 
compiled on their own.

The firebird-php list will help with getting Firebird running, but you 
need the firebird-support list for UDF's - it's not a PHP problem!

Anatol ogórek wrote:
I noticed, that in the newest PHP release there was added udf file for
interbase/firebird , that allows to execute php functions from sql. I
got interested in it, but after few hours of trying I gave up...
I use Firebidr 1.5 default instalation.
I compile udf file as it is written in c file:
gcc -shared `php-config --includes` `php-config --ldflags`  `php-config
--libs` -o php_ibase_udf.so php_ibase_udf.c
SNIP
Another question is how to open transaction for two different
connections. I saw in changelog that it is possible in newest version
http://www.php.net/manual/en/function.ibase-trans.php
Just add a another pair of arguments for each connection you want to 
combine in a 2-phase commit.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: PHP and Firebird

2004-12-01 Thread Lester Caine
Anatol ogrek wrote:
I got php+firebird working without any problem.
I am also able to create and compile simple udf for firebird.
Good to hear :)
I found that one UDF in php source so I thought that maybe someone of 
you managed to use that extension.
I miss read what you were doing - where is that file as it would be 
worth a look at. In any case, that IS the sort of thing we like to play 
with on the firebird-php list ;)

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Firebird and PHP

2004-11-19 Thread Lester Caine
Mario Lacunza wrote:
Is possible work with Firebird ? and how?
Perfectly possible.
Just use the ibase_* functions.
Windows or Linux
Old windows getting started is at
http://www.ibphoenix.com/main.nfs?a=ibphoenixpage=ibp_beginners_php
Help with linux can be found on the firebird-php list
http://groups.yahoo.com/group/firebird-php
You will get Firebird related help there.
--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: [EMAIL PROTECTED] November 2, 2004

2004-11-01 Thread Lester Caine
Joseph Crawford wrote:
Do we care? Realy? Unlikely. Maybe you should send your 'useful' info on
 a national mailinglist only.
i am sorry but i do care, if you do not care about voting you dont
care if the war comes to the US.
There are many more of us who do not have the right to vote in the US, 
just as we do not have the right to claim our 3.5% guaranteed mortgage. 
Americans need to start thinking about OTHER countries rather than 
assuming that they can just bombard every list with 'relevant' 
information that is totally irrelevant to the rest of the world.

THAT is one of the major reasons the rest of the world gets p*d of 
Americans ;)

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Apache 1.3.31, php 5.0.2 and firebird 1.5

2004-10-25 Thread Lester Caine
Luciano Eicke wrote:
ok...  PDO_firebird was the wrong dll.
i should have used php_interbase.dll instead.
Yes - you will find more help on firebird and php at
http://groups.yahoo.com/group/firebird-php
The rather old GSG is at
http://www.ibphoenix.com/main.nfs?a=ibphoenixpage=ibp_beginners_php
and there is a tikifirebird site which should be active next month 
running on Apache2, PHP5 and Firebird 1.5 watch on the firebird-php list 
for details ;)

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-30 Thread Lester Caine
Lukas Smith wrote:
mysql:
http://marc.theaimsgroup.com/?l=pear-devm=108239153527834w=2
ibase:
http://marc.theaimsgroup.com/?l=pear-devm=108240351804395w=2
there are other interesting points being discussed through out this 
thread but with a noteably focus on the pear abstraction layers.
Interesting thing from my point of view - both done on Apache2
ADOdb is not giving me any problems, but this does show that a switch to 
raw ibase will give me a performance boost if I need it.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-04 Thread Lester Caine
Hans Lellelid wrote:
No, that's true; no Firebird yet.  Drivers needed :)  It's basically a 
slightly modified version of the JDBC API for PHP.  
Now THAT might be the correct way forward. I already use the 
Firebird-Jaybird interface when running plug-ins on Eclipse without any 
problems, but I can't see any JDBC API for PHP ?

It does not use 
MySQL as an authority on SQL ;)  I use it primarily with PostgreSQL -- 
and to a lesser extent SQLite and MySQL.
We could do with a base set of computable SQL functions. I have a 
cross-reference for MySQL, PostgreSQL and SQL2003 against Firebird, but 
keeping track with the changes to MySQL has had to be dropped - which 
version/sub version etc. ...

Of cause what is actually needed is a good standard XML SQL interface - 
hopefully before Microsoft patent it ;)

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-04 Thread Lester Caine
Lester Caine wrote:
No, that's true; no Firebird yet.  Drivers needed :)  It's basically a 
slightly modified version of the JDBC API for PHP.  
Now THAT might be the correct way forward. I already use the 
Firebird-Jaybird interface when running plug-ins on Eclipse without any 
problems, but I can't see any JDBC API for PHP ?
OK found the answer to that - creole IS the JDBC API for PHP :)
--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-03 Thread Lester Caine
Hans Lellelid wrote:
You definitely should do your own benchmarks.  Bear in mind that the 
ADOdb benchmarks test a certain type of behavior -- namely repeated 
select statements.  Also bear in mind that the speeds of the different 
layers are going to be inversely proportional to how well they actually 
/abstract/ stuff.  For example, ADOdb would completely fail to be 
portable accross databases where the case of the column names in result 
array changes (e.g. postgres always returns lowercase col names, Oracle 
always uppercase, MySQL returns mixed case, SQLite is configurable). 
This is one example of why some layers (like PEAR::[M]DB) may be slower.
So you start with ADOdb datadict and build the database from that - 
works well when adding any supported engine. Reserved words which differ 
between engines are another problem area though.

Database abstraction is a really tricky thing.  None of these layers 
provide 100% abstraction; that can only really be achieved with a 
DAO/object persistence layer (e.g. see DB_DataObject in PEAR, or Propel 
http://propel.phpdb.org).
Usual problem is adjusting non-standard MySQL SQL back to SQL99 or 2003, 
but each engine has it's own 'style' :)

I would also suggest you also add Creole (http://creole.phpdb.org) to 
your test list if you are considering abstraction layers for PHP5.
Doesn't do Firebird yet ;) - but it looks interesting. As long as it has 
not made the mistake of using MySQL as the SQL standard. Many other 
packages are simply MySQL wrappers with cobbled support for a couple of 
other engines.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-03 Thread Lester Caine
Jeffrey Moss wrote:
Doesn't do Firebird yet ;) - but it looks interesting. As long as it has
not made the mistake of using MySQL as the SQL standard. Many other
packages are simply MySQL wrappers with cobbled support for a couple of
other engines.
I was curious about Firebird as I've heard it mentioned a lot lately.
What's so great about it in your opinion, in comparison to MySQL and
Postgress? (currently I use both of these)
Firebird is the open source version of Interbase, which is itself 20 
years old this week.
Firebird has had triggers, stored procedures, User defined functions, 
events, and runs on a large number of OS's for many years.
Current 'records' for database size exceed 200Gb and there are many 
systems running with over 10Gb databases in real time.
Firebird should be compared to Oracle rather than MySQL and to a lesser 
extent PostgreSQL. Both of the later are some way off providing all of 
the currently available Firebird facilities. And all of those facilities 
are licence free in Firebird - no looking over you shoulder at MySQL 
licences ( not sure about PostgreSQL -  it would not run on Windows when 
I last looked at it ;) )
Firebird installs and runs 24/7 without DBA's or manual intervention.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-02 Thread Lester Caine
John Holmes wrote:
I'd personally recommend ADOdb for no other reason than that's what I 
use and it's effective.
Seconded.
John Lim who wrote ADOdb is always updating it with input from users.
PEARdb does seem to have caught up, but lots of third party applications 
are already available that use ADOdb or have moved to it (or are moving) 
in later updates.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-02 Thread Lester Caine
Ed Lazor wrote:
Has any performance testing been done between ADOdb and PEARdb?
Not recently. Personally I am still trying to benchmark engines within 
ADOdb against the latest Firebird.

This is an area where any results would be useful. There are speed 
comparisons on the ADOdb site, but they are a couple of years out of 
date. The ADOdb accelerator does make a difference if speed is a 
problem, but I don't have any major bottlenecks (YET) ;)

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-02 Thread Lester Caine
Jean-Philippe Côtê wrote:
I thought the point of such discussion lists as php-db was to be able to
maturely discuss these questions.
I understand that people have different opinions and that's exactly what I'm
looking for. I'm hoping to receive pointers in one or the other direction and
then I can make an educated decision.
Just check the archive. There are many 'heated debates' on this so we 
try not to be antagonistic.

I am sure if I started again now I would probably be using something 
other than ADOdb. But at the time it fitted the bill and where there 
were problems they were quickly cleared. Unlike some of the other 
options I tried.

Now *I* am happy with ADOdb and see no reason to change, so I don't keep 
up with other packages and can't contrast. So answering some of your 
questions is difficult.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Dear php experts

2004-08-29 Thread Lester Caine
Bishnu wrote:
I am new in PHP. I've just started programming with php. I am going to build a 
newsletter mailing of my own community.
I use a table where members' name, email and other information is stored. I would like 
to send email to all member listed on member table. Could anyone give me functional 
code for it?
I'd probably start from one of the working systems ;)
Have a look at the list at http://www.opensourcecms.com/
--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Lotus Notes DB to MySQL?

2004-08-28 Thread Lester Caine
Chris Payne wrote:
I have a client who uses Lotus Notes for her database, now she wants it
converted to MySQL, is that possible?  What format is notes DB in?
Basically I will write a new front-end and back-end for her so she doesn't
need notes anymore (Nasty, nasty software) but I need to import her old data
first.
If memory serves me correctly, you can export from Notes as a CSV text 
file, and then import that. It's been some time since I had to do it, 
but I am sure that was the path I used to get the contacts data into an 
Interbase database.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] retrieved data from mysql to be shown in spreadsheet

2004-08-23 Thread Lester Caine
Balwantsingh wrote:
I am developing a page using PHP for entering the data into tables made in
mysql.   I want that when user click on Reports button the data (which will
retrieve from mysql) should be shown in Spreadsheet (Calc) of Open Office.
Pls. tell how it can be done.
Does MySQL have a JDBC driver?
If so, then you can create the reports you want in OpenOffice and save 
them as OpenOffice documents. You can then just create a link to the 
document.
Not the most efficient way of doing things, but it should work, I don't 
have any problem with Firebird via it's JDBC driver.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: LAMP

2004-08-03 Thread Lester Caine
Gavin Amm wrote:
I'd really like to find a Linux distro that is a LAMP system right out
of the box.
(Linux, Apache, MySQL, PHP)
Are there any out there?
Thankfully not ;)
I want LAFP but LAPP seems still to be more popular on Linux.
WHY does everybody run lemming like after MySQL. It STILL has to catch 
up with the better FREE database engines ;)

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: LAMP

2004-08-03 Thread Lester Caine
Jason Wong wrote:
I want LAFP but LAPP seems still to be more popular on Linux.
WHY does everybody run lemming like after MySQL. It STILL has to catch
up with the better FREE database engines ;)
It depends on your needs. For simple storage of data (involving few 
relationships) then MySQL is more than sufficient and a tried and tested 
solution. This probably covers the vast majority of the data storage needs of 
web apps. No sense in going for a DB with features you're never ever going to 
use and is probably slower to boot.
Ever tried?
I have always used Interbase and now Firebird. It has useful things like 
triggers and stored procedures. These are implemented in the database 
engine, so do not need all the miles of additional code I find in many 
MySQL examples that are provided.

Firebird is a perfect complement to PHP and allows me to scrap or 
simplify PHP pages because the engine takes care of the business rules 
of managing data.

SQLite is a different matter and the obvious new base for beginners, but 
for real applications ...

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: LAMP

2004-08-03 Thread Lester Caine
John W. Holmes wrote:
Right... I find a great need for triggers and stored procedures in my
guestbooks and shoutboxes.
Come on people, the right tool for the right job. MySQL is supported on more
hosts and fills the needs of most web developers. This is like arguing over
which editor to use!
And because of that other better engines do not get supported, and we 
get told - Move to MySQL if you want to host here.

It is only the right tool for some jobs, otherwise why are they going 
hell for leather to add all these supposedly unnecessary features TO 
MySQL ;)

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: LAMP

2004-08-03 Thread Lester Caine
Gary Every wrote:
The answer to that is SPEED. Nothing short of Oracle comes even
close
You must have a big cheque book.
I get just as fast a system without having to pay a penny over the cost 
of the hardware ;)

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: LAMP

2004-08-03 Thread Lester Caine
Jason Wong wrote:
The answer to that is SPEED. Nothing short of Oracle comes even
close
You must have a big cheque book.
I get just as fast a system without having to pay a penny over the cost
of the hardware ;)
Hmm, if I'm not mistaken, I think he means that *unless* you have a big cheque 
book to pay for Oracle then MySQL is the next fastest thing around.
You need a cheque book for MySQL as well.
I am already replacing Oracle servers and don't need any pseudo-open 
source software to do it :)

The bottom line is that we are disparate for a proper benchmarking 
system which shows performance, capability and cost of ownership. My 
system may not be the best, but I don't have to look over my shoulder 
all the time worrying if I am going to get into licensing difficulties. 
However it would be nice to know WHERE engines are in the scale of 
things. The appearance of many more in the last few years is just a 
waste of development effort that could be concentrated on a few projects 
that cover the basic spread of requirements.
IBM passing the Cloudscape, and CA passing theirs to Open Source are 
just muddying the waters further.

( Anybody who does not know which database I use can ask privately if 
they are interested ;) )

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: LAMP

2004-08-03 Thread Lester Caine
Jason Wong wrote:
The answer to that is SPEED. Nothing short of Oracle comes even
close
You must have a big cheque book.
I get just as fast a system without having to pay a penny over the cost
of the hardware ;)
Hmm, if I'm not mistaken, I think he means that *unless* you have a big cheque 
book to pay for Oracle then MySQL is the next fastest thing around.
You need a cheque book for MySQL as well.
I am already replacing Oracle servers and don't need any pseudo-open 
source software to do it :)

The bottom line is that we are disparate for a proper benchmarking 
system which shows performance, capability and cost of ownership. My 
system may not be the best, but I don't have to look over my shoulder 
all the time worrying if I am going to get into licensing difficulties. 
However it would be nice to know WHERE engines are in the scale of 
things. The appearance of many more in the last few years is just a 
waste of development effort that could be concentrated on a few projects 
that cover the basic spread of requirements.
IBM passing the Cloudscape, and CA passing theirs to Open Source are 
just muddying the waters further.

( Anybody who does not know which database I use can ask privately if 
they are interested ;) )

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Call to undefined function mysql_connect()

2004-08-01 Thread Lester Caine
Phpdiscuss - Php Newsgroups And Mailing Lists wrote:
I agree to you as my phpinfo does not show mysql at all. can you help me
as in how do i get the mysql support for the same, im using PHP/MYSQL on
windows 2000
By default on PHP5, MySQL is not now built in ( since more and more of 
us are no longer using it ;) ).

First thing to do is enable the php_mysql.dll line in the Extensions 
section of the php.ini file ( working copy should be in c:\WINNT )

Second thing - which I can't help with - is MySQL itself installed on 
the machine :)

Third thing - have a look at some of the alternatives ;)
--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: generating reports in php

2004-07-30 Thread Lester Caine
Carlos Merino wrote:
Thanks for the replies, I have been testing Agata, the problem is that 
is a desktop tool,
And will only work with PHP4
I need something  to generate and store the report but I need the report 
available to
be regenereted in a web request, I don´t  want static reports I just 
need something similar
to  http://sourceforge.net/projects/phpreports  whithout using sablotron 
libraries.
My stating point was
http://www.interaktonline.com/products/overview_8.html
I have a working setup into a Firebird database that did not take too 
much effort, now I just need to convert 30 reports from FastReports ;)

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Getting PHP for Windows to talk to MS SQL?

2004-07-25 Thread Lester Caine
[EMAIL PROTECTED] wrote:
I discovered that PHP was not looking at C:\php\php.ini. Rather, somehow
it was looking at C:\Windows\php.ini. Anyway, now all is well. 
Yep - that is the right place on windows.
--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: content managment systems

2004-06-16 Thread Lester Caine
Justin Patrin wrote:
Pete M wrote:
I use www.tikiwiki.org
love it
I just started using it and it's very nice. Here's a quick hint to those 
who are new, though. You can click the :: to expand the menu. If I'd 
only known this when I started
Take a look at the tikipro version. You will be able to select which 
modules you want to load on the next version.
www.tikipro.org

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Mysql not receiving the data

2004-06-13 Thread Lester Caine
Andrew Rothwell wrote:
Hi Larry, Thank you very much for the very quick response, I set my php.ini
file (located /etc/php.ini ) for the register_globals = On (it was off by
default)
Now however I get an error 
Error adding entry: You have an error in your SQL syntax near 's spanish
driver is found shot dead, Inspector Jacques Clouseau is the first off' at
line 8
I would think it fairly obvious that the extra ' in the text you are 
loading is causing a problem, use an ` instead, or escape the single 
'
Not sure if MySQL uses '' or \' :)

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Firebird

2004-03-31 Thread Lester Caine
Alireza Balouch wrote:

It looks like firebird database is on its way to replace of mysql... its
totaly free (commersial  open source) use
but it isn't any php functions for that so we must use ODBC ...
Dose anyone knows if PHP developpers have any plans to make som e firebird
functions?
No need it works perfectly with the interbase package. I do 
have a better Firebird1.5 abstraction for ADOdb, but it's 
not ready to be 'published' :)

Most of us are waiting for PHP5 before producing a Firebird 
native build of the interbase package, as the extra 
functions are well worth having.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: How to simplify DB creation?

2004-03-19 Thread Lester Caine
Michal Masa wrote:

We plan to write a simple DB with app. 10 tables. Are there any tools that
simplify and automatize the creation of PHP scripts for the database?
Like automatic generation of PHP scripts that produce HTML input forms,
generation of value lists, validation, sorting and searching?
Well documented PHP library could be also useful.
Something to solve world conflict as well?

Seriously. PHP is not a database, so the first problem is 
what database do you want to use.

Personally I use ADOdb library into Firebird and it works 
well for me, but it does not 'automatically' do much.
http://php.weblogs.com/ADODB

On Firebird we have a nice PHP web interface
http://ibwebadmin.sourceforge.net/
but it's only good for Interbase and Firebird.
I have yet to find something that will do everything, but 
the starting point is probably - which database, and there 
are specific tools for each, before getting to the PHP bit.

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


[PHP-DB] Re: Firebird support

2004-03-19 Thread Lester Caine
Maximiliano Robaina wrote:

There are any plan about support for direct access to Firebird SQL DBMS?
The interbase dll driver include in php 4.x work fine with Firebird 1.5?
Both PHP4 and the enhanced PHP5 Interbase drivers are fine.

There is a continual discussion on the firebird-php yahoo 
list about a conversion, and perhaps when PHP5 is stable 
that will form the basis.

But in the meantime just use the Interbase one.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Root-Server Firebird PHP

2003-12-11 Thread Lester Caine
My own install worked OK with RC4, but it may be worth a 
look through the firebird-php list as there are a few other 
'fixes' listed.
http://groups.yahoo.com/group/firebird-php

I've pressure to complete a W2k based job before Xmas 
otherwise I would be having another look myself. I'm sure we 
need an 'idiots guide' just to tidy this up :)

Frank Kieselbach wrote:

Hello,
I have a root-server (Suse 8.1, PHP 4.2.2) and i will use
firebird (1.5) with php.
I have install firebird and create my database
with tables and data. It works (isql).
In the first step i will use firebird with the interbase.so.
I do this:
../configure --with-interbase=shared,/opt/firebird
This is ok
Then i do:
make
...
Making all in interbase
make[2]: Entering directory `/usr/local/php4/php-4.2.2/ext/interbase'
make[3]: Entering directory `/usr/local/php4/php-4.2.2/ext/interbase'
/bin/sh /usr/local/php4/php-4.2.2/libtool --silent --mode=link gcc -
I. -I/usr/local/php4/php-4.2.2/ext/interbase -I/usr/local/php4/php-
4.2.2/main -I/usr/local/php4/php-4.2.2 -I/usr/include/apache -
I/usr/local/php4/php-4.2.2/Zend -I/opt/firebird/include -
I/usr/local/php4/php-4.2.2/ext/mysql/libmysql -I/usr/local/php4/php-
4.2.2/ext/xml/expat  -DEAPI_MM -D_LARGEFILE_SOURCE -
D_FILE_OFFSET_BITS=64 -DHARD_SERVER_LIMIT=2048 -
DDYNAMIC_MODULE_LIMIT=128 -DSSL_EXPERIMENTAL_PERDIRCA_IGNORE -
DSSL_EXPERIMENTAL_PROXY_IGNORE -DLINUX=22 -DMOD_SSL=208110 -DEAPI -
I/usr/local/php4/php-4.2.2/TSRM -g -O2   -o interbase.la -avoid-
version -module -rpath /usr/local/php4/php-4.2.2/modules
interbase.lo  -R/opt/firebird/lib -L/opt/firebird/lib -lgds
/usr/lib/gcc-lib/i486-suse-linux/3.2/../../../../i486-suse-
linux/bin/ld: cannot find -lgds
collect2: ld returned 1 exit status
make[3]: *** [interbase.la] Error 1
make[3]: Leaving directory `/usr/local/php4/php-4.2.2/ext/interbase'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/php4/php-4.2.2/ext/interbase'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/php4/php-4.2.2/ext'
make: *** [all-recursive] Error 1
i see an error, but i dont now what i must do.

Can anybody help me?

Thank you.

Frank

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Apache 2

2003-11-03 Thread Lester Caine
lots of people seem to post/think different things, but each time Rasmus
posts to these lists, he says PHP/Apache2 is not a production ready combo.
if you search the PHP-INSTALL archives for his name or Apache2, you'll find
his posts.
That said - I have not had any problems with PHP4, and am 
now running PHP5 on a test rig - again no problems coming up.

If it's not getting tested how will we know anyway?

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: crosstab (was Re: [PHP-DB] Using two colomns ...)

2003-10-20 Thread Lester Caine
% Then I'm not calling it the right thing... just the name of the type
% of query that was told.  The kind of query I'm talking about is the 
% one that rotates the result set from tall to wide.  Basically doing 
% exactly what the OP had asked for.  If
Hmmm...  You mean like taking results
 1 a
 2 b
 3 c
 4 d
and changing it to
 1 2 3 4
 a b c d
or such?  I'm certainly confused.
More or less, yes.  exactly that.
ADOdb - PivotTableSQL() and it works with any database engine.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


  1   2   >