Using SQL Server with PHP [closed] - php

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

Related

Using PHP with PostgreSQL instead of MySQL [closed]

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.

Why we are not using php in Hadoop framework? [closed]

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 4 years ago.
Improve this question
Any specific reason we are not using php in Hadoop framework?
There's nothing stopping you from using PHP for Hadoop Streaming MapReduce (assuming PHP can read from standard input and write to standard output).
And there's also not much preventing PHP from being able to query HBase or Hive or Spark Thrift Server assuming a driver exists that allows for that.
The only main issue is that you cannot use the core Java libraries very easily and most services would need exposed via REST, for example.
Any Hadoop web UI could probably be rewritten in PHP, if needed, but it's too much context switching, in my opinion.
A libhdfs C extension does exists, I've not seen it widely used. If you did want to interact directly with HDFS, that's probably the most performant way. Webhdfs would be an alternative
But you'd have to ask the core Hadoop developers why PHP isn't used.

How does PHP (mysqli or pdo) run MySQL commands? [closed]

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.

Which on is better? php on iis or php on WAMP Server on windows server 2003(VDS) [closed]

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
I have a VDS(Virtual Dedicated Server) that Windows Server 2003 is installed on it. I want to use php and MySQL on my VDS. I have two options: 1-install wamp server as a web server or 2-install iis and then use php and MySQL on iis.
Which one do you suggest me to use?
Wamp is a great tool for development but it's not very secure and fast for production.
In my opinion, on Windows the best option is IIS, faster and more secure.
You can easily find some tests by searching on Internet :
https://groups.drupal.org/node/234373
I recommand wamp, more stable and efficient.

Connect to MS SQL Server from PHP on Linux? [closed]

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 3 years ago.
Improve this question
I need to connect to an MS SQL Server database from a PHP script running on a Linux server. I'm looking at using FreeTDS as there is no official MS SQL Server driver for Linux. Is this my best option? Is it ok in a production environment? Are there other options, perhaps ODBC?
The company I work for has been running FreeTDS to connect to SQL 2000 on our production server for almost 6 years now. There's a couple of issues with special character encoding, but overall it works well.
Is the best free option. I've used it with Qt (C++).
You can use it with unixODBC.
If you can pay it you could use the driver from easysoft

Categories