pdo

How to install/enable pdo-odbc driver on a php docker container?

感情迁移 提交于 2020-05-28 11:26:52
问题 I am currently having trouble writing a Dockerfile for my php application. My Dockerfile works but lacks the pdo-odbc driver I need to connect to an MS SQL Server database. Here is my current Dockerfile: FROM php:apache RUN apt-get install && \ apt-get update && \ apt-get install tdsodbc unixodbc unixodbc-dev -y && \ docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr && \ docker-php-ext-enable pdo_odbc && \ a2enmod rewrite && \ service apache2 restart && \ sed -ri -e 's!/var/www

How to install/enable pdo-odbc driver on a php docker container?

我的未来我决定 提交于 2020-05-28 11:25:27
问题 I am currently having trouble writing a Dockerfile for my php application. My Dockerfile works but lacks the pdo-odbc driver I need to connect to an MS SQL Server database. Here is my current Dockerfile: FROM php:apache RUN apt-get install && \ apt-get update && \ apt-get install tdsodbc unixodbc unixodbc-dev -y && \ docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr && \ docker-php-ext-enable pdo_odbc && \ a2enmod rewrite && \ service apache2 restart && \ sed -ri -e 's!/var/www

How to install/enable pdo-odbc driver on a php docker container?

我与影子孤独终老i 提交于 2020-05-28 11:25:27
问题 I am currently having trouble writing a Dockerfile for my php application. My Dockerfile works but lacks the pdo-odbc driver I need to connect to an MS SQL Server database. Here is my current Dockerfile: FROM php:apache RUN apt-get install && \ apt-get update && \ apt-get install tdsodbc unixodbc unixodbc-dev -y && \ docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr && \ docker-php-ext-enable pdo_odbc && \ a2enmod rewrite && \ service apache2 restart && \ sed -ri -e 's!/var/www

How to install/enable pdo-odbc driver on a php docker container?

纵然是瞬间 提交于 2020-05-28 11:24:26
问题 I am currently having trouble writing a Dockerfile for my php application. My Dockerfile works but lacks the pdo-odbc driver I need to connect to an MS SQL Server database. Here is my current Dockerfile: FROM php:apache RUN apt-get install && \ apt-get update && \ apt-get install tdsodbc unixodbc unixodbc-dev -y && \ docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr && \ docker-php-ext-enable pdo_odbc && \ a2enmod rewrite && \ service apache2 restart && \ sed -ri -e 's!/var/www

loading a PHP class object from a database--best practices, database handle, etc

ぐ巨炮叔叔 提交于 2020-05-18 02:50:53
问题 I think perhaps my questions have been answered in part in other locations on stackoverflow, but I felt I might get a more comprehensive answer by asking it all together. I apologize for anything dumb I might type--I don't work in PHP nearly enough, so when I do, I feel like I'm learning it all over again. Anyway, let's say I've got a mysql database table called "items" with the following columns: item_id , item_type , item_name . And I've got a PHP class that looks like this: class Item {

PHP sqlite is returning all strings no matter what data type is defined

放肆的年华 提交于 2020-05-15 05:35:14
问题 I'm running unit tests using the sqlite in memory database and I've run into an issue. When I perform the tests using a mysql database, the following comparison works properly if ($item->user_id === Auth::id()) It will evaluate to true if the numbers match and false if they don't. When I use the sqlite in memory database the conditional statement will always return false because the user_id attribute is returned as a string instead of the proper int data type. I've read a few posts and

Can't get going with MySQL in CakePHP

早过忘川 提交于 2020-05-13 06:34:05
问题 This is my first time installing a framework, and I am pretty clueless. I am on OSX 10.7 and I have the cakephp framework loaded into /Library/WebServer/Documents/cakephp and I have been able to load the test page and get rid of some of the errors and warnings. Right now I am trying to resolve this Warning (2): PDO::__construct() [pdo.--construct]: [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) [CORE/Cake/Model/Datasource/Database/Mysql.php, line 160]

Can't get going with MySQL in CakePHP

旧街凉风 提交于 2020-05-13 06:33:20
问题 This is my first time installing a framework, and I am pretty clueless. I am on OSX 10.7 and I have the cakephp framework loaded into /Library/WebServer/Documents/cakephp and I have been able to load the test page and get rid of some of the errors and warnings. Right now I am trying to resolve this Warning (2): PDO::__construct() [pdo.--construct]: [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) [CORE/Cake/Model/Datasource/Database/Mysql.php, line 160]

Fetching and displaying Data for Each Registered User in PHP using PDO [duplicate]

…衆ロ難τιáo~ 提交于 2020-05-09 17:28:26
问题 This question already has answers here : PDO displaying data from database foreach specific ID (3 answers) Closed 21 days ago . I have been trying to fetch data from the database and display each user's data on their dashboard, but what is giving me is the whole data in the database. I have tried many fetch data functions but some will give me error. I had check round the web and here to see if I can get something close to mine challenge but I have not been able to get any helpful one. This

Reduce stock from product when an order is created

一世执手 提交于 2020-05-09 12:01:06
问题 I'm doing an inventory project where you can create orders and product receptions. Each order can have multiple products. The database is like this: CREATE TABLE `inventorio_orden` ( `inventorio_orden_id` int(11) NOT NULL, `usuario_id` int(11) NOT NULL, `inventorio_orden_fecha` date NOT NULL, `inventorio_orden_destino` varchar(255) COLLATE ucs2_spanish_ci NOT NULL, `inventorio_orden_nombre` varchar(255) COLLATE ucs2_spanish_ci NOT NULL, `inventorio_orden_status` enum('active','inactive')