-5
I have a PDO connection file. To include this connection in other system files in order to make the requests in the database, I will use this????
<?php require('conexao.php'); ?>
-5
I have a PDO connection file. To include this connection in other system files in order to make the requests in the database, I will use this????
<?php require('conexao.php'); ?>
3
Well, your doubt was 'half' vague for me, I mean, half is just not to say completely, but anyway...
The archive PDO
that Voce must be referring to works as a classe
, usually create a separate file and make only one require_once
for practicality, but of course, if in any interaction with the bank, you want to open a conexão
with the bank manually, it is so vc put in your code without making references
Here at the company we use 3 classes
for connection to a bank...
pdo.php
<-- where we make the connection, say physical;
cmd_sql.php
<-- where we create classes to help us assemble the SQL
;
dadosconectabanco.php
<-- where we put the necessary data in the pdo.php
to make the connection to the bank
In the latter it is worth mentioning that we should create one for each system, because it should contain more specific information about the bank that Voce will connect, be SQL
, oracle
or anyother.. type information: Porta
, IP
, Schema
, <--[1] Tabela
, Login
, senha
, etc, etc.
[1] - These Voces can be placed directly on PDO
, many times this data is half standard
Browser other questions tagged php mysql pdo
You are not signed in. Login or sign up in order to post.
Okay... now, what’s your question?
– MarceloBoni
responding: yes..... more any information?
– MarceloBoni
If you who know the contents of the file are in doubt, imagine us.
– Bacco