Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
NOTE: This is not about which better database, not at all.
Hi, my client has a shared host with the following stack:
PHP: 7.x.x
MySQL: 5.6.x
Postgres: 9.2.x
PhpMyAdmin
PhpPgAdmin
I'm able to use both MySQL(PHP) and PostgreSQL(C#, Go, Python, JS), but I personally prefer Postgres, also my client's host specs make it harder to use some SQL features like CTE which have no support in MySQL 5.6 (I know 8.0 has them).
The problem:
I plan to use Postgres, but I'm a little concerned about the combination of PHP+Postgres, since it seems that most PHP development is coupled with MySQL, for example, PhpMyAdmin is activly developed compared to PhpPgAdmin (the last release from 2018), also it seems it ALWAYS assumed that PHP runs using MySQL while Postgres is like a second citizen.
So, in your experience, should I go with Postgres or MySQL, to minimize the trouble that may arise?
Thanks.
I have used php with postgresql for about 20 years off and on. The driver is stable enough. You lack built-in support for some of the fancier data types in PostgreSQL (or used to anyway) - ranges, arrays etc.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
When using mysqli or PDO in a PHP script what are the mechanics that take place for the sql query to run?
Does the mysqli module run shell_exec() with a mysql command? I'm sure there is something more here.
Edit
More specifically what I wanted to know was what is the process that PHP takes to actually make a MySQL call, what are the mechanics involved for PHP to have access to the database.
There is a thing called Mysql C API.
Both PHP extensions are written by implementing low-level C functions from this API.
It connects directly over a socket to the server. There is no way to have connection pooling if you're just doing shell_exec(), which you may have noticed is an option. Not only that, but running another executable for every single query is insanely slow. As the other answer has mentioned, PHP uses C-bindings for Mysql which do all the hard work reading/writing sockets.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I used this tutorial to set up PHP on my server, but now my question is about MySQL. There are a lot of tutorials for unix like systems but for windows I can't find one which would work for me.
I took a look at this one, but it seems to be out of date, cause I can't find some files (my-medium.ini, my.ini) in mysql-5.6.15 folder.
I'll try an answer, easier to format ;)
You need to realize that there is no link between Nginx and MySQL. Nginx doesn't need to know that MySQL exists and the opposite is true.
And there is a small link with Php and MySQL, but in fact, it doesn't matter if the database is on your computer or another server. Php will just take the URL of the database to connect to it. If it's on your computer or somewhere else, it will work. You could even connect to multiple different databases on different computers.
All this to say that all you need to do (related to the MySQL installation) is to install MySQL on your Windows 7 machine. If the installation worked (normally, only executing an EXE file and pressing next, next, next), you'll be able to connect to it with php. Just note the PORT where MySQL will listen (it should be displayed in the wizard installation) and also remember the username password that you'll set for connecting to your MySQL server (it should be asked throughout the installation wizard).
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
PHP was originally made to interface with MYSQL. I'm wondering what is the difficulty level and how the best way to go about using PHP with SQL Server 2008 r2 is. I've done some research and it seems like there are some usable libraries. Is this something that is feasible on the production level?
PHP has a library for dealing with MSSQL (http://php.net/manual/en/book.mssql.php). You also might consider using something like PDO with its appropriate driver (http://www.php.net/manual/en/ref.pdo-sqlsrv.php) if you would like a more abstracted library to work with.
There is a SQL Server driver that works under windows: http://www.microsoft.com/en-ca/download/details.aspx?id=20098
http://php.net/manual/en/book.mssql.php
take a look at http://puurunen.ca/blog/?p=139
You should find there some info on sql server 2008 r2 PDO implementation
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
The SQLite extension is enabled by default as of PHP 5.0. Beginning
with PHP 5.4, the SQLite extension is available only via PECL.
Ok, I'm relatively new in PHP programming, and I was wondering what does this quoted information from official PHP site mean?
I wrote some applications that runs SQlite rather than MySQL database and I have serious concern if is it going to be deprecated from future versions of PHP.
What does it means "from now, only via PECL"?
I understand that SQlite will be available but doesn't that mean that:
PHP team will pay at least less attention on future development of PHP/SQlite integration
we could expect web hosting providers that will miss installing SQlite extension, as it is not by default any more?
Does someone have experience about what's happen when PHP "throw away" extension to PECL?
Thanks in advance.
I'm not 100% sure, but it looks to me like PHP is dropping support for the old SQLite extension in 5.4 in favour of the (newer and better) SQLite3 extension.
The SQLite3 extension is enabled by default as of PHP 5.3.0.
A major benefit of SQLite is how simple it is to setup—and having it as part of the PHP core is important to keeping it that way. I don't see that changing.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm in search of the web hosting space, and got to know the PHP version is 4.3 and MySQL Version 4.1
But i developed my application in MySQL version 5.x and PHP version 5.x
Can anyone give me the differences in versions ?
what all i cannot access now ?
Thanks...
PHP version 5 I look at as when PHP became a real language, for a whole bunch of reasons, but most importantly because it became possible to write respectable Object Oriented code.
But don't deemphasize the difference between MySQL 4 and 5 - I think it's even deeper and more significant. MySQl 5 was when MySQL became a real relational database platform, for a whole bunch of reasons, but most importantly because it became possible to write fully expressive SQL statements (starting with full subquery support).
Just those two limitations on the earlier versions are, I hope, showstoppers for you. There's no reasonable excuse for accepting less than version 5 of either.
Why not take a look at the PHP docs:
http://www.php.net/manual/en/migration5.php
http://www.php.net/manual/en/faq.migration5.php
http://www.php.net/manual/en/migration5.incompatible.php
With regards to MySQL you can track changes in versions here:
http://dev.mysql.com/doc/mysqld-version-reference/en/key-changes.html
Major new features added to MySQL 5.0 and 5.1 that may not work/won't work in 4.x can be located here:
MySQL 5.0 - http://dev.mysql.com/doc/refman/5.0/en/mysql-nutshell.html
MySQL 5.1 - http://dev.mysql.com/doc/refman/5.1/en/mysql-nutshell.html
Here is a basic overview of the release history. PHP 5 was a big change.
I won't go into huge detail on the differences though since PHP 4 is deprecated. Stick with PHP 5 & MySQL 5. I'd be surprised if a webhost didn't offer PHP 5 as well as 4. 4 should only be used with legacy code and should never be used for new development.