Re: [PHP-DB] use php variable within postgresql query

2023-06-12 Thread Karl DeSaulniers
Oh I see now I am late to the conversation. Slow email load. Carry on. > On Jun 12, 2023, at 1:42 PM, Karl DeSaulniers wrote: > > Hi, > I am assuming this is just a typo in your post and not your code, correct? > (see quoted text below) > If not, then try the other bracket? > >

Re: [PHP-DB] use php variable within postgresql query

2023-06-12 Thread Karl DeSaulniers
Hi, I am assuming this is just a typo in your post and not your code, correct? (see quoted text below) If not, then try the other bracket? $query=$_GET['databasecolumn']; > On Jun 9, 2023, at 4:05 AM, e-letter wrote: > > $query=$_GET['databasecolumn'[;

Re: [PHP-DB] use php variable within postgresql query

2023-06-12 Thread Michael Oki
Meanwhile, you should probably use prepared statements to avoid SQL injection. On Mon, 12 Jun 2023 at 16:03, e-letter wrote: > First, sorry for the mistake to type a sanitised version of code. > Should have been: > "$query=$_GET['databasecolumn'];" > > After some rtfm, confused as a

Re: [PHP-DB] use php variable within postgresql query

2023-06-12 Thread e-letter
First, sorry for the mistake to type a sanitised version of code. Should have been: "$query=$_GET['databasecolumn'];" After some rtfm, confused as a non-computer-programmer why it is necessary to set the $_GET parameter. The overall simple scenario is to view a postgresql database in a series of

Re: [PHP-DB] use php variable within postgresql query

2023-06-09 Thread Aziz Saleh
That was a bad copy/paste on his part. Syntax errors will not allow PHP to even run the code. On Fri, Jun 9, 2023 at 11:14 AM G. Franklin wrote: > My friends, > > Would not the syntax of "$query=$_GET['databasecolumn'[;" be part of the > issue? > > I believe the brackets should be closed like

Re: [PHP-DB] use php variable within postgresql query

2023-06-09 Thread G. Franklin
My friends, Would not the syntax of "$query=$_GET['databasecolumn'[;" be part of the issue? I believe the brackets should be closed like this, no? "$query=$_GET['databasecolumn'];" ~G. On Fri, 9 Jun 2023 at 10:53, Aziz Saleh wrote: > Read and understand these, should help you: > >

Re: [PHP-DB] use php variable within postgresql query

2023-06-09 Thread Aziz Saleh
Read and understand these, should help you: https://www.php.net/manual/en/language.types.array.php Basically its databasecolumnname get param is not defined (set) causing the query to fail also. On Fri, Jun 9, 2023 at 5:06 AM e-letter wrote: > Readers, > > Suppose: > >

RE: [PHP-DB] what does the mysqli real connect MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT flag do? How to disable only CN validation?

2023-03-23 Thread John Wythe
lt;http://www.epicor.com/> Ph: 250-260-6495 E-Mail: jwy...@epicor.com From: Aziz Saleh Sent: Wednesday, March 22, 2023 7:36 PM To: John Wythe Cc: php-db@lists.php.net Subject: Re: [PHP-DB] what does the mysqli real connect MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT flag do? How to disab

Re: [PHP-DB] what does the mysqli real connect MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT flag do? How to disable only CN validation?

2023-03-22 Thread Aziz Saleh
That flag uses SSL encryption but disables validation of the provided SSL certificate. This is only for installations using MySQL Native Driver and MySQL 5.6 or later. On Wed, Mar 22, 2023 at 4:50 PM John Wythe wrote: > mysqli_real_connect has a parameter called flags than can be passed to >

Re: [PHP-DB] MySQLnd support for ed25519

2021-09-08 Thread dimi_php
Hi Ruprecht, yes, if a provider not changed the default authentication (mysql_nativ_password) there is nothing customers have to do, because the default authentication on mysql 5.7 and 10.5 is the same (SHA-1 based). Mysql changed this starting from version 8, were the default authentication

RE: [PHP-DB] MySQLnd support for ed25519

2021-09-08 Thread Jonathan Aquilina via php-db
Mysql 8 is already the stable version and has been for a while. I for development use it on windows and its v8 -Original Message- From: Ruprecht Helms Sent: 08 September 2021 16:02 To: php-db@lists.php.net Subject: Re: [PHP-DB] MySQLnd support for ed25519 Hi Dimi, I think mysql 8

Re: [PHP-DB] MySQLnd support for ed25519

2021-09-08 Thread Ruprecht Helms
Hi Dimi, I think mysql 8 is the new version of mysql. I don't know if there a exists a stable release or only a beta. My thoughts are that the last php-version maybe can handle the mentioned authentication method or you have to try to compile the handling for the mysql-plugin in the

Re: [PHP-DB] MySQLnd support for ed25519

2021-09-07 Thread Ruprecht Helms
Hi Dimi, hi everyone, I don't know about this algorithm. On one running server and on my local linuxbox there is Mysql running. On another server the provider changed from mysql to mariadb. As reason for the change from mysql 5.7 to mariadb 10.5 the provider only told his customers that

Re: [PHP-DB] Realtime connection to postgres database

2020-11-09 Thread Karl DeSaulniers
Is this what you are looking for? https://www.postgresql.org/docs/9.6/monitoring-stats.html or maybe this? https://github.com/supabase/realtime Google Foo: real-time connection to postgresql

Re: [PHP-DB] Realtime connection to postgres database

2020-10-26 Thread Karl DeSaulniers
Sounds like a good cron job candidate. Best, Karl Sent from losPhone > On Oct 25, 2020, at 4:43 PM, Aziz Saleh wrote: > > Another way to do this is to have an ajax call on timeout to an update > endpoint, if there is an update inject that update on the page (or refresh > it). > > Some js

Re: [PHP-DB] Realtime connection to postgres database

2020-10-25 Thread Aziz Saleh
Another way to do this is to have an ajax call on timeout to an update endpoint, if there is an update inject that update on the page (or refresh it). Some js examples (both short/long polling): https://stackoverflow.com/questions/42825972/update-html-when-change-is-noticed-in-mysql-database

Re: [PHP-DB] Can connect to Mysql via command line but not via browser

2020-10-12 Thread Roberto Carlos Garcia Luis
: Aziz Saleh > Sent: Thursday, September 3, 2020 3:09 PM > To: Tai Larson > Cc: php-db@lists.php.net > Subject: Re: [PHP-DB] Can connect to Mysql via command line but not via > browser > > Are both connected to the same network? Just asking because I see a local > ip for serv

RE: [PHP-DB] Can connect to Mysql via command line but not via browser

2020-09-03 Thread Tai Larson
The are connected to the same network. I’m setting up a development environment. From: Aziz Saleh Sent: Thursday, September 3, 2020 3:09 PM To: Tai Larson Cc: php-db@lists.php.net Subject: Re: [PHP-DB] Can connect to Mysql via command line but not via browser Are both connected to the same

Re: [PHP-DB] Can connect to Mysql via command line but not via browser

2020-09-03 Thread Aziz Saleh
Are both connected to the same network? Just asking because I see a local ip for server ip/name. Maybe try with public IP instead see if it helps. On Thu, Sep 3, 2020 at 5:51 PM Tai Larson wrote: > I have a MySQL database server and a separate web sever running Apache. > Both are running Centos

Re: [PHP-DB] Getting PDO-OCI to work in PHP 7

2019-05-28 Thread christopher . jones
Possibly try a two stage build: - build your main PHP without PDO_OCI - build PDO_OCI as a shared library with a simplified configure command that doesn't have ldap. Then move the resulting PDO_OCI library to your first PHP install and update php.ini. Then test thoroughly. I have had to do

Re: [PHP-DB] PHP mysqli is NOT trapping some errors when calling stored procedure

2019-02-12 Thread Venkat Hariharan
Yes, I do have all reqd privs. In fact, as long as a duplicate key situation isnt encountered, I am able to invoke the stored proc from PHP alright and the record gets saved in the database. But when I try to re-do it using the same value (thereby I am expecting that 1062-DUPLICATE KEY error

Re: [PHP-DB] PHP mysqli is NOT trapping some errors when calling stored procedure

2019-02-12 Thread Aziz Saleh
Do you have sufficient privileges to execute stored procedures (procs_priv) on PHP's end? On Tue, Feb 12, 2019 at 11:07 AM Venkat Hariharan wrote: > Can you take a look at the issue that I've described at > >

Re: [PHP-DB] MySQL connection

2017-03-05 Thread Karl DeSaulniers
That makes complete sense. Thank you Joshua. Best, Karl DeSaulniers Design Drumm http://designdrumm.com > On Mar 5, 2017, at 6:44 PM, Arneson, Joshua wrote: > > If you have multiple calls to the database that are grouped, definitely > perform them during the same

Re: [PHP-DB] MySQL connection

2017-03-05 Thread Arneson, Joshua
If you have multiple calls to the database that are grouped, definitely perform them during the same connection session. The bottom line is unless the overhead associated with opening and closing the connection is going to be an issue programmatically, keep connections brief and group your

Re: [PHP-DB] MySQL connection

2017-03-05 Thread Karl DeSaulniers
Ah, thanks for the reply Joshua. Duly noted. So when is it bad to make multiple open and close connections then? I am guessing that could have some impact with lots of users too. Yes? If the website in question does not have a lot of users (less than 1,000), is this still a bad call to keep an

Re: [PHP-DB] MySQL connection

2017-03-05 Thread Arneson, Joshua
Right off the bat, you need to consider concurrency issues. Depending on the size of your user base and level of activity this could become a major issue. In the end, why hold an open connection for 15 minutes just to process 20-30 transactions that take 20-30ms each? Just better (under most

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 : > >> > 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

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

2016-11-22 Thread Delmar Wichnieski
2016-11-22 12:42 GMT-02:00 Lester Caine : > 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

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

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

2016-11-22 Thread Delmar Wichnieski
But VARCHAR fields work correctly. Problem only in CHAR. 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

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

Re: [PHP-DB] Any method to get primary key matching a given value ?

2016-10-14 Thread B. Aerts
Hi Ratin, check out this FAQ : https://sqlite.org/faq.html#q7 SQlite has a read-only table that holds the creation query for each table. By doing a text analysis of this query, you can find out which field is declared as primary key. Regards, Bert On 11/10/16 02:12, Ratin wrote: Sorry

Re: [PHP-DB] Any method to get primary key matching a given value ?

2016-10-10 Thread Karl DeSaulniers
You may be correct. Admittedly, I am stabbing in the dark here. I work on MySQL, not SQLite. Just good at key word searches. :) This link seems to be promising. http://www.sqlite.org/c3ref/table_column_metadata.html Sorry I can't help more. Best, Karl DeSaulniers Design Drumm

Re: [PHP-DB] Any method to get primary key matching a given value ?

2016-10-10 Thread Ratin
Hi Karl, Isnt it the same ? I am doing the check if ($result['pk'] == 1), and you are doing if ($result['pk'] !== null). I wanted to make sure I dont get false positives, what if $result['pk'] is set to zero, in your case it will be a match but thats probably not what we want, cuz the pk field

Re: [PHP-DB] Any method to get primary key matching a given value ?

2016-10-10 Thread Karl DeSaulniers
Hi Ratin, I "think" you can just do this and not have to store the table name. However, I have no way of testing this. You will have to test on your end. while ($result = $query->fetchArray()) { if ($result['pk'] !== null) { $primary_key=$result['pk']; } } Best,

Re: [PHP-DB] Any method to get primary key matching a given value ?

2016-10-10 Thread Ratin
Sorry about my late reply but this was my function - a bit of a hack but works properly on my version of php-sqlite3: function get_primary_key_name($table) { $primary_key=''; $db = new MyDB(); if(!$db) { echo

Re: [PHP-DB] Corn job anomaly

2016-09-27 Thread Karl DeSaulniers
> On Sep 27, 2016, at 2:24 AM, Ford, Mike <m.f...@leedsbeckett.ac.uk> wrote: > >> -Original Message- >> From: Karl DeSaulniers [mailto:k...@designdrumm.com] >> Sent: 25 September 2016 09:59 >> To: PHP List Database <php-db@lists.php.net>

RE: [PHP-DB] Corn job anomaly

2016-09-27 Thread Ford, Mike
> -Original Message- > From: Karl DeSaulniers [mailto:k...@designdrumm.com] > Sent: 25 September 2016 09:59 > To: PHP List Database <php-db@lists.php.net> > Subject: Re: [PHP-DB] Corn job anomaly > > Now I am getting an error with mysql syntax. > > "

Re: [PHP-DB] Corn job anomaly

2016-09-25 Thread Karl DeSaulniers
ard > <inbound-lists-...@listmail.innovate.net> wrote: > > > >> Date: Sunday, September 25, 2016 08:37:14 -0400 >> From: Aziz Saleh <azizsa...@gmail.com> >> Subject: Re: [PHP-DB] Corn job anomaly >> >> On Sun, Sep 25, 2016 at 4:59 AM, Karl DeS

Re: [PHP-DB] Corn job anomaly

2016-09-25 Thread Richard
> Date: Sunday, September 25, 2016 08:37:14 -0400 > From: Aziz Saleh <azizsa...@gmail.com> > Subject: Re: [PHP-DB] Corn job anomaly > > On Sun, Sep 25, 2016 at 4:59 AM, Karl DeSaulniers > <k...@designdrumm.com> wrote: > >> > On Sep 23, 2016, at

Re: [PHP-DB] Corn job anomaly

2016-09-25 Thread Aziz Saleh
On Sun, Sep 25, 2016 at 4:59 AM, Karl DeSaulniers wrote: > > On Sep 23, 2016, at 5:38 AM, Richard innovate.net> wrote: > > > > > > > >> Date: Friday, September 23, 2016 03:28:47 -0500 > >> From: Karl DeSaulniers > >> >

Re: [PHP-DB] Corn job anomaly

2016-09-25 Thread Karl DeSaulniers
> On Sep 23, 2016, at 5:38 AM, Richard > wrote: > > > >> Date: Friday, September 23, 2016 03:28:47 -0500 >> From: Karl DeSaulniers >> >> Ok, so I have run down all the possible things (that I know of) >> that could be keeping

Re: [PHP-DB] Corn job anomaly

2016-09-23 Thread Richard
> Date: Friday, September 23, 2016 03:28:47 -0500 > From: Karl DeSaulniers > > Ok, so I have run down all the possible things (that I know of) > that could be keeping this from working. I have checked with my > hosting service that: > > 1. MySQL is accessible with the

Re: [PHP-DB] Corn job anomaly

2016-09-23 Thread Karl DeSaulniers
Ok, so I have run down all the possible things (that I know of) that could be keeping this from working. I have checked with my hosting service that: 1. MySQL is accessible with the original user I started with (for this case were using db123456) via ssh. 2. The cron is accessing my php script

Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread Karl DeSaulniers
> On Sep 20, 2016, at 10:09 PM, Peter Beckman wrote: > > I suspect you are taking the pipe or semicolon literally. > > Drop the pipe and semicolon entirely. This should work: > >/usr/bin/php5 -c /home/123456/etc/php.ini -f > /home/123456/data/auto_reminder.php > >

Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread Peter Beckman
I suspect you are taking the pipe or semicolon literally. Drop the pipe and semicolon entirely. This should work: /usr/bin/php5 -c /home/123456/etc/php.ini -f /home/123456/data/auto_reminder.php The "pipe" (|) in unix (and I assume this is unix) means to pipe the output of php5 -c config

Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread Karl DeSaulniers
Hi Richard & Bert, Thanks for the responses. I think I understand what you are both saying. Not sure where my database is housed as I am using a hosting provider (Mediatemple) and they allow limited access to such things or I am unaware how to access them. For my current issue, lets just say

Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread B. Aerts
On 20/09/16 10:06, Lester Caine wrote: 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

Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread Richard
Original Message > Date: Tuesday, September 20, 2016 12:54:38 -0500 > From: Karl DeSaulniers > > On Sep 20, 2016, at 7:21 AM, Richard > wrote: >> >> >> >>> Date: Tuesday, September 20, 2016 03:26:39

Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread Karl DeSaulniers
On Sep 20, 2016, at 7:21 AM, Richard wrote: > > > >> Date: Tuesday, September 20, 2016 03:26:39 -0500 >> From: Karl DeSaulniers >> >>> On Sep 20, 2016, at 3:22 AM, Lester Caine >>> wrote: >>> On

Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread Richard
> Date: Tuesday, September 20, 2016 03:26:39 -0500 > From: Karl DeSaulniers > >> On Sep 20, 2016, at 3:22 AM, Lester Caine >> wrote: >> >> On 20/09/16 09:14, Karl DeSaulniers wrote: >>> Pardon my ignorance, but what do you mean full path? >> Full path

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

Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread Karl DeSaulniers
> On Sep 20, 2016, at 3:22 AM, Lester Caine wrote: > > 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

Re: [PHP-DB] Cron job anomaly

2016-09-20 Thread Karl DeSaulniers
> On Sep 20, 2016, at 3:20 AM, Lester Caine wrote: > > 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 >>

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

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

Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread Karl DeSaulniers
> On Sep 20, 2016, at 3:14 AM, Karl DeSaulniers wrote: > >> On Sep 20, 2016, at 3:06 AM, Lester Caine wrote: >> >> 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

Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread Karl DeSaulniers
> On Sep 20, 2016, at 3:06 AM, Lester Caine wrote: > > 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

Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread Karl DeSaulniers
> On Sep 20, 2016, at 3:06 AM, Lester Caine wrote: > > 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

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

Re: [PHP-DB] Corn job anomaly

2016-09-20 Thread Karl DeSaulniers
> On Sep 20, 2016, at 12:16 AM, Karl DeSaulniers wrote: > >> On Sep 19, 2016, at 6:14 AM, Richard >> wrote: >> >> >> >>> Date: Monday, September 19, 2016 03:26:54 -0500 >>> From: Karl DeSaulniers >>> >>>

Re: [PHP-DB] MySQL two tables and an uneven number of rows

2016-09-19 Thread Karl DeSaulniers
Thanks Bert, Sorry for late response, but I had to step away from this for a moment to work on other things. Will most likely be back though as things are not working still. Thank you for your responses. Best, Karl DeSaulniers Design Drumm http://designdrumm.com > On Sep 13, 2016, at 2:15

Re: [PHP-DB] Corn job anomaly

2016-09-19 Thread Karl DeSaulniers
> On Sep 19, 2016, at 6:14 AM, Richard > wrote: > > > >> Date: Monday, September 19, 2016 03:26:54 -0500 >> From: Karl DeSaulniers >> >> I am hoping someone can enlighten me on this issue I am having. >> I am trying to set up a

Re: [PHP-DB] Corn job anomaly

2016-09-19 Thread Richard
> Date: Monday, September 19, 2016 03:26:54 -0500 > From: Karl DeSaulniers > > I am hoping someone can enlighten me on this issue I am having. > I am trying to set up a cron job to run a php file. > I am getting a strange error though. > > /home/(protected

Re: [PHP-DB] MySQL two tables and an uneven number of rows

2016-09-13 Thread B. Aerts
On 13/09/16 08:42, Karl DeSaulniers wrote: On Sep 12, 2016, at 2:53 PM, B. Aerts wrote: On 12/09/16 05:24, Karl DeSaulniers wrote: Hello All, Hoping you can help clear my head on this. I have two MySQL tables for custom fields data to be stored. custom_fields

Re: [PHP-DB] MySQL two tables and an uneven number of rows

2016-09-13 Thread Karl DeSaulniers
> On Sep 12, 2016, at 2:53 PM, B. Aerts wrote: > > On 12/09/16 05:24, Karl DeSaulniers wrote: >> Hello All, >> Hoping you can help clear my head on this. I have two MySQL tables for >> custom fields data to be stored. >> >> custom_fields

Re: [PHP-DB] Any method to get primary key matching a given value ?

2016-09-02 Thread B. Aerts
Hi Ratin, working with sqlite, are you ? In that case, take a look at the default table : SELECT sql from sqlite_master where type= "table" and name = "" This query returns the creation query of the table concerned. By parsing it textually, you can find out the field name that was declared

Re: [PHP-DB] Any method to get primary key matching a given value ?

2016-08-20 Thread Karl DeSaulniers
This may also shed some light for you. The accepted answer and possibly the one below it if you are on .NET http://stackoverflow.com/questions/763516/information-schema-columns-on-sqlite HTH, Best, Karl DeSaulniers Design Drumm http://designdrumm.com > On Aug 20, 2016, at 5:30 AM, Karl

Re: [PHP-DB] Any method to get primary key matching a given value ?

2016-08-20 Thread Karl DeSaulniers
Hey Ratin, Have you looked into the table column named 'pk' inside table_info? That is where a column is indicated to be a primary key or not. Best, Karl DeSaulniers Design Drumm http://designdrumm.com > On Aug 18, 2016, at 6:51 PM, Ratin wrote: >

Re: [PHP-DB] Any method to get primary key matching a given value ?

2016-08-18 Thread Ratin
Hi Karl, Thanks a lot for your response, I think INFORMATION_SCHEMA is not available for sqlite database. I had to built up the whole query with php using PRAGMA table_info(tablename), looking at the pk entry, when its 1, get the column name, and then update the sql statement based on that. A bit

Re: [PHP-DB] Any method to get primary key matching a given value ?

2016-08-18 Thread Karl DeSaulniers
Hi Ratin, Going to take a stab at this one. Have you looked into INFORMATION_SCHEMA.COLUMNS for your query? Might be where you want to look for what you are trying. Sorry can't help more. Best, Karl DeSaulniers Design Drumm http://designdrumm.com > On Aug 18, 2016, at 1:27 PM, Ratin

Re: [PHP-DB] Connecting to database fails

2016-08-15 Thread Rich Shepard
On Sat, 13 Aug 2016, Lester Caine wrote: 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 installed: /usr/lib/php/extensions/pgsql.so

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 -

Re: [PHP-DB] Connecting to database fails

2016-08-13 Thread Rich Shepard
On Sat, 13 Aug 2016, Rich Shepard wrote: Not installed. I'll search the Web to learn how to install it. 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. Thanks again, Rich -- PHP Database Mailing List

Re: [PHP-DB] Connecting to database fails

2016-08-13 Thread Rich Shepard
On Sat, 13 Aug 2016, Lester Caine wrote: 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. Lester, Well, that would make a difference. I did not know how to check for this.

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

Re: [PHP-DB] weird string literal related problem

2016-08-01 Thread Ratin
nvm, I got my answer -- foreach ( $entries as $column => $value ) will give the column names .. which simplifies my task a lot. On Mon, Aug 1, 2016 at 12:52 PM, Ratin wrote: > Just curious why the values can only be accessed by column names and not > an array subscript, like :

Re: [PHP-DB] weird string literal related problem

2016-08-01 Thread Ratin
Just curious why the values can only be accessed by column names and not an array subscript, like : $i=0; $result = $db->query('select * from DecoderUser'); while ($entries = $result->fetchArray()) { $value=$entries[i]; $i = $i + 1; } On Mon, Aug 1, 2016 at 12:25 PM, Ratin

Re: [PHP-DB] weird string literal related problem

2016-08-01 Thread Ratin
Thanks Aziz, that works. Somehow i thought the ' needed to be included just like you quote all strings on an interactive DB shell or even when you get the value directly by column name. On Mon, Aug 1, 2016 at 11:47 AM, Aziz Saleh wrote: > But if i print

Re: [PHP-DB] weird string literal related problem

2016-08-01 Thread Aziz Saleh
But if i print $entries['decoderUserGUID'] I get the correct value This means the key value is decoderUserGUID NOT 'decoderUserGUID', try creating $strIndex without the quotes, just the key value. On Mon, Aug 1, 2016 at 2:31 PM, Ratin wrote: > Hi I am new to this list, not

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

2016-01-27 Thread Alko Kotalko
Your answer in the part of SAP HANA (J)ODBC driver not supporting named parameters actually makes sense. However I don't understand why would there be a difference between PDO and regular odbc (odbc_connect, etc.) commands since they're obviously using the same driver. My testing machine is on

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

2016-01-26 Thread Karl DeSaulniers
On Jan 26, 2016, at 7:10 AM, Alko Kotalko wrote: > Hi, > > I have a working connection from PHP to SAP HANA through PDO and regular > ODBC commands. > > The issue is that through PDO I can not get any prepared statements to > work. None of the notations (?, $, :) work.

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

2016-01-26 Thread Jeff
Greetings, On 01/26/2016 08:18 AM, Karl DeSaulniers wrote: > On Jan 26, 2016, at 7:10 AM, Alko Kotalko wrote: > >> Hi, >> >> I have a working connection from PHP to SAP HANA through PDO and regular >> ODBC commands. >> [...snipped...] >> >> For example: >> "SELECT *

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

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

2016-01-26 Thread Alko Kotalko
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. The queries get executed but the returned result (if I fetch one) is an

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

2016-01-26 Thread Alko Kotalko
It shouldn't be like that because I'm preparing a statement, which would later have had parameters passed to. I'm not trying to concatenate a string. (Sorry, forgot to reply to all before) On Tue, Jan 26, 2016 at 8:18 AM, Karl DeSaulniers wrote: > On Jan 26, 2016, at 7:10

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

2016-01-26 Thread Alko Kotalko
This (my code) actually works so it's not part of the problem. The problem is that I can NOT use the colon notation for named parameters, even though that's my goal :) If I use the colon notation with MySQL (PDO) it works fine. With ODBC and SAP HANA database it doesn't. I have to use either ? or

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

2016-01-26 Thread Karl DeSaulniers
Oh ok, thanks for the clarification. Sorry for the noise. Best, Karl DeSaulniers Design Drumm http://designdrumm.com On Jan 26, 2016, at 1:07 PM, Alko Kotalko wrote: > It shouldn't be like that because I'm preparing a statement, which would > later have had

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

Re: [PHP-DB] Correct Syntax?

2015-10-30 Thread chimurenga chimurenga
make vehicle licence the unique key On 14 Oct 2015 00:28, "Karl DeSaulniers" wrote: > > Quick question. Is this viable in MySQL? > > UNIQUE KEY `Vehicle_Name` (`Vehicle_Make`+`Vehicle_Model`+`Vehicle_Style`+`Vehicle_License`) > > TIA > > Best, > > Karl DeSaulniers > Design

Re: [PHP-DB] Correct Syntax?

2015-10-13 Thread Roberto Spadim
instead of +, use ",' 2015-10-13 20:21 GMT-03:00 Karl DeSaulniers : > Quick question. Is this viable in MySQL? > > UNIQUE KEY `Vehicle_Name` > (`Vehicle_Make`+`Vehicle_Model`+`Vehicle_Style`+`Vehicle_License`) > > TIA > > Best, > > Karl DeSaulniers > Design Drumm >

Re: [PHP-DB] Zero Values

2015-09-02 Thread Karl DeSaulniers
On Sep 1, 2015, at 10:36 PM, Ethan Rosenberg wrote: > Dear List - > > I have a payment/charges table - > > mysql> describe Charges; > +--+--+--+-+-+---+ > | Field| Type | Null | Key | Default

Re: [PHP-DB] Zero Values

2015-09-02 Thread Karl DeSaulniers
On Sep 2, 2015, at 11:02 PM, Ethan Rosenberg wrote: > Dear list - > > I know that I am making a mistake somewhere. but am lost for an answer. > > mysql> select Payments from Charges where if(Payments, Payments, 0); > +--+ > | Payments | >

Re: [PHP-DB] Zero Values

2015-09-02 Thread Ethan Rosenberg
On 09/01/2015 11:43 PM, Aziz Saleh wrote: On Tue, Sep 1, 2015 at 11:36 PM, Ethan Rosenberg < erosenb...@hygeiabiomedical.com> wrote: Dear List - I have a payment/charges table - mysql> describe Charges; +--+--+--+-+-+---+ | Field| Type

Re: [PHP-DB] Zero Values

2015-09-01 Thread Aziz Saleh
On Tue, Sep 1, 2015 at 11:36 PM, Ethan Rosenberg < erosenb...@hygeiabiomedical.com> wrote: > Dear List - > > I have a payment/charges table - > > mysql> describe Charges; > +--+--+--+-+-+---+ > | Field| Type | Null | Key |

Re: [PHP-DB] For my understanding

2015-07-25 Thread Aziz Saleh
On Sat, Jul 25, 2015 at 9:33 PM, Karl DeSaulniers k...@designdrumm.com wrote: Hello, This might be a question better suited for the general php list. If it is, please let me know. I have inherited some pages that have a code on it I don't recognize. Can anyone enlighten me as to what this

Re: [PHP-DB] Grouping results

2015-07-23 Thread Karl DeSaulniers
Well, I figured it out. It took two queries. Probably a better way I'm not thinking about, but this works in case anyone needs/wants. Was hoping to do it all in the SQL statement I guess. $FieldGroups = $wpdb-get_results(SELECT DISTINCT Field_Group FROM .table_name); foreach($FieldGroups as

Re: [PHP-DB] How Do I Enter a Defect Against PHP ODBC Extension?

2015-07-10 Thread Chupaka
https://bugs.php.net/ -- Подпись: (добавляется в конце всех исходящих писем) 2015-07-08 21:25 GMT+03:00 Bruce Bailey brucebailey...@gmail.com: I have discovered a defect in the PHP extension, odbc.so. Specifically the function odbc_fetch_array is not properly handling boolean values from

Re: [PHP-DB] PHP ODBC odbc_fetch_array returns uninitialized values for Booleans

2015-06-29 Thread Bastien Koert
Is it a truly a three state field (true, false, null) or just T/F? Perhaps a default value for the field might be better? On Mon, Jun 29, 2015 at 11:42 AM Bruce Bailey brucebailey...@gmail.com wrote: *Description* The PHP function odbc_fetch_array returns uninitialized values for PostgreSQL

Re: [PHP-DB] Re: سلام دوست من

2015-06-23 Thread Aziz Saleh
It's spam message, been sent almost every other day. 2015-06-23 11:06 GMT-04:00 Jim Giner jim.gi...@albanyhandball.com: On 6/2/2015 2:17 PM, Mahsa Ehsani wrote: زمان ثمردهي‌اش گذشته بود و دوره بازنشستگي را طي مي‌كرد. روزگاري طراوت و سرسبزي داشت و كودك و بزرگ از قِبَلِ او مرزوق بودند. اما

  1   2   3   4   5   6   7   8   9   10   >