Premium Essay

Nt1330 Unit 1 Assignment 1

Submitted By
Words 404
Pages 2
To establish a connection with a MySQL server, a data source name (DSN) is created in which connection parameters are specified, and also the UserName and Password of your MySQL account is also used.

$db = new PDO("DSN", "Username", "Password"); where, DSN = Data Source Name(DSN) is a string of multiple arguments that indicates the database driver(esp. mysql), a hostname, in which the server actually is processed and the name of the database to whom we have to connect. Syntax:- mysql:host=host_name;dbname=db_name
Username = Username of the database
Password = Password of the database
Eg :-
$db = new PDO( "mysql:host=localhost;dbname=testing" , "test_user" , "test_pass" );

Closing the Connection
When you are finished using the connection, simply close it by setting the database handler to NULL …show more content…
PHP will throw an exception, if “new PDO()” constructor fails. The returned object from the constructor method is a database handler used for interacting with the server till the end of the connection.
When the database handler is open and you are using it to issue other PDO calls, you should arrange to handle error if they occur.
If you enable exception, you also have the option of catching them yourself instead of permitting them to print a backtrace and terminating the script.
To enable exceptions, set the PDO error mode as follows after connecting for checking for an error after each PDO

Similar Documents

Premium Essay

Nt1330 Unit 1 Assignment 1

... Be Organised: Check that I have enough time available to devote to the task and will have no distractions in this time. Make sure that I have all learning material at hand and within easy reach of my seat. Be comfortable sitting and have the computer at a comfortable and ergonomic position. Check that wifi connected and have enough 'access' time to complete the task to be worked on. Go to the toilet to eliminate that distraction and make myself a cup of coffee to have while I am reading learning material. 2. Reading: Read the appropriate material at least twice, taking notes to points that I feel will be important to remember. I like to have quiet while I am reading, although this is not essential just a preference. I will read material a number of times until I think I have a good understanding of what is being said. I sometimes read out aloud if I am having trouble understanding something and that is probably why it is a good idea that I am alone. I try to understand a concept before I move onto the next step, rather than flyby the seat of my pants. 3. Minimise distractions: Keep the environment as noise free and distraction free as possible. Allocate the time for studying when there will be less distractions around me, so keeping aware of other peoples comings and goings in the household to be able to use the time home alone whenever I can. Ignore the door and phone as much as possible, to the point of rudeness sometimes. Do not access e-mails until after study time is complete...

Words: 478 - Pages: 2

Premium Essay

Nt1330 Unit 1 Assignment 1

...NT1330 Mr. Ajero Assignment 1 September 14, 2015 DNS – Domain Name System DNS is a hierarchical representation of all the IT devices and their sub-domains in a (company) network. So, in case you see an address like mail.subdomain.company.com, you can easily recognize the name of the system (mail), name of the sub-domain (sub-domain), name of the company (company) and the name of the primary domain (.com). DHCP – Dynamic Host Control Protocol A DHCP server automatically assigns the IP addresses for a device. Any device, before communicating with any other device in the network needs an IP address. These IP addresses are given to the network devices dynamically by a DHCP server (IP addresses ought to be within a certain range and the range is already specified). The IP addresses assigned this way are not permanent – they are actually leased for a certain amount of time to the devices (till they log-out of the network, for example). I believe that two hosts should be sufficient. Using a DHCP Relay Agent would greatly reduce the time necessary for me to set up the name allocation and resolution. If I were to do this manually on a static IP Address, I would have to put a stop to it at 25 machines as it would waste valuable time with trying to get to the other pieces of equipment my client owns. Regardless of if I was getting paid by the hour, I would need extra time for future maintenance and upgrades References DNS and DCHP explanation/definition:...

Words: 276 - Pages: 2

Free Essay

Nt1330 Unit 1 Assignment 1

...EN1330 Client-Server Networking 2 Unit 1. Assignment 1 9/25/2014 A Domain Name System (DNS) is a hierarchical distributed naming system for computers, services, or any resources connected to the internet or a private network. It associates various information with domain names assigned to each of the participating entitles. It translates easily memorized domain names to the numerical IP addresses needed for the purpose of locating computer services and devices worldwide. The best way that I have been able to explain it, it works like a phone book for the internet by translating hostnames into IP addresses. But unlike a phone book, the DNS can easily be updated and quickly. The internet maintains two principal namespaces, the domain name hierarchy and the Internet Protocol address spaces. A DNS name server is a server that stores the DNS records for a domain name, such as (A or AAA) records, name server records, and mail exchanger records. A DNS name server responds with answers to queries against its database. The Dynamic Host Configuration Protocol is a Standardized networking protocol used in Internet Protocol networks for dynamically distributing network configuration parameters, such as IP addresses for interface and services. With DHCP computers request IP addresses and networking parameters automatically from a DHCP server, reducing the need for a network administrator or a user to configure these settings manually. DHCP is used by computers for requesting Internet...

Words: 323 - Pages: 2

Premium Essay

Nt1330 Unit 1 Assignment 1

...Permissions clarified: Let`s begin with a clarification for what every consent implies. Remember that authorizations can be set at both the organizer and the document level. The table underneath frameworks what every authorization accomplishes for both organizers and documents. Full control: The client has full control to the organizer and can include, change, move and erase things. The client can likewise include and evacuate authorizations the organizer and for any subfolders. The stressed sentence is vital to remember. This authorization level can be hazardous in the wrong hands. The client has full control to the file and can change, move or erase it. The client can likewise include and expel permissions the file. Modify: A blend of Read and Write authorizations. A client likewise can erase files inside an organizer that has the Modify authorization. She can likewise see the substance of subfolders. A client can adjust the substance of the chose document. Perused and execute Users are permitted to peruse the substance of documents in the folder or execute programs inside the folder. Users are permitted to peruse the substance of the file or execute the system. List organizer contents: Allows the client to see the substance of the chose folder. The client is not permitted to peruse a file's substance or execute a file. This consent is not accessible at the document level Read: The client can read the substance of a folder. The client can read the substance of a document...

Words: 1870 - Pages: 8

Premium Essay

Nt1330 Unit 1 Assignment 1

...At ADSD, the database administrator (DBA) is responsible for the performance, integrity and security of the container databases including the root, the PDB seed and the user-developed pluggable databases. The DBAs should also be intrinsically involved in the planning, development, testing and deployment of the database consolidation initiative. 1.4.2.6.1 Responsibilities • Installation, configuration, upgrades, and consolidation: Although system administrators are typically responsible for the hardware and operating system on a given server, installation and configuration of the database software is typically done by the DBA. The DBA should possess knowledge of the hardware prerequisites and requirements for a high-performing database server. The DBA installs the database software and configures it for the purpose it is intended for use. As new releases and patches are developed, the DBA decides on the appropriate patches, tests them on a test server that replicates the production server and then installs them on the production server. If a new server is commissioned to replace an old one, then the DBA migrates the database from the old server into the newly commissioned server. Automating server provisioning is the responsibility of the DBA also. With automated provisioning, consistency in the installed and configured servers is maintained. Additionally, several servers can be commissioned at the same time instead of one at a time if done manually. Hence, automated provisioning...

Words: 733 - Pages: 3

Premium Essay

NT1330 Unit 1 Assignment 1

...At 2:40pm MT on 2/17/2016, the Credit LEAD database encountered a row lock. As a result, database connections maxed out, causing the Credit LEAD application to become unavailable at 2:48pm. A restart of the application servers was conducted at approximately 2:55pm, clearing out any row locks in the database. Application service was restored and validated at 3:11pm. Root cause appears to be related to an increased latency causing performance issues with the Credit LEAD application. Reports indicate the application servers had sufficient memory and CPU to handle the database calls. Additionally, the database showed very quick response times. There was a report of increased response times (latency) from 2:40pm to 2:52pm. However, there is no evidence to support the argument that this increase in latency caused the Credit LEAD issues. Latency is a general term that can be attributed to a number of factors such as router/switch issues, cabling issues, utilization issues, or a general increase in network load. Each of these issues would leave noticeable evidence. Network Operations was able to find none. Occasional spikes in latency do occur and are common throughout the day, if they had been sustained for any extended period of time, errors, monitoring, and impact to other critical systems or applications would have been clearly visible. This is typical of a prolonged and widespread network issue. Given the evidence, it is reasonable to believe that the database issues were not...

Words: 662 - Pages: 3

Premium Essay

NT1330 Unit 1 Assignment 1

...Network 1 is for Computer A and Network 2 is for Computer B. Network 1 is connected to the same router as Network 2. Network 1 and Network 2 already have their own IP addresses. Suppose network 1 IP address is 10.1.1.0/62 and network 2 IP address is 172.16.1.0/62. The Interface for Network 1 connecting to router is 10.1.1.1 and router connecting to Network B is 172.16.1.1. Computer A (client computer requesting for data) IP address is 10.1.1.100 which is connected to Network 1 and Computer B (servers receiving data and sending data packets to the Computer A requesting data) IP address is 172.16.1.100 with a web server of port 80. Once, a person searches the IP address 172.16.1.100 (of Computer B) in the web browser, the computer will automatically start to establish a TCP connection for the IP address Computer A is requesting. Web browser on Computer A will start to communicate with the local network and identify the networking stack with subnet mask which in our case is Network 1 with an IP address of 10.1.1.0/24 showing that the IP address we are looking for is on another network, in our case Network 2. Then, Computer A creates ARP request for IP address of 10.1.1.1 which is then sent to every node until it reaches the router. Once...

Words: 1409 - Pages: 6

Premium Essay

Nt1330 Unit 1 Assignment 1

...would likely become unrealistic to resolve names and IP addresses manually because of the fact that it would take far too much time. You should also keep in mind that if you have a DHCP or DNS server or any servers in general then you are going to have to keep it on at all times otherwise your users will be unable to connect to the internet because they will not have an IP address. Or if they are able connect to the internet then they will have errors when they type in the web address then they will not be able to fix them. As far as the IT-management overhead when referring to DHCP or DNS you should also keep in mind the facts stated previously. First of all it can be very cost ineffective if you try to run a DNS or DHCP server for just 1 or 2 PC’s. The reason for this is that servers require much more to operate and maintain than your standard PC also you will have to train somebody within the company to understand how servers work and operate or hire someone new who knows possess these...

Words: 334 - Pages: 2

Premium Essay

Nt1330 Unit 1 Assignment 1

...Windows 2008 Network Services Setting up DNS and DHCP for 5, 15 or 25 client computers is completely worth it in my opinion. There are many reasons why it is worth it but I will cover 2 of the most important in my view. Before I explain I need to make clear that it is important that all of the client computers on you network need to have an operating system that is current enough so that it supports DNS and DHCP, otherwise there is no point and those systems will have to be upgraded. The first reason for installing DHCP is the ease of setup. With DHCP the client sends a request to the server asking for an IP address. The server then automatically assigns one to the client out of the existing pool. Being that this is done automatically there is no need for the administrator to manually configure each client. Once the request is sent the client is assigned an IP address for an allotted time period, once the lease has expired a new request has to be sent and either the same or a new IP address will be assigned to that client. The server ensures that while an IP address is in use no other clients are assigned that IP address ensuring that no signal confusion happens. The second reason for installing DHCP is that all settings are handled in one central location on the server. Lease lengths, IP addressing range, IP addressing subnet setup and many other factors are all administrated from the server. Having this ability to manipulate and monitor all of these settings in one...

Words: 331 - Pages: 2

Premium Essay

Nt1330 Unit 1 Assignment 1

... • On a biweekly timeframe, I process the AU server enclave’s vulnerability scans, scans reviews, and address the remediation for the critical, high and medium vulnerabilities. • Regularly address the FISMA data call requests. • Actively developed, documented and am implementing the processes for 18 items identified in the Plan of Action and Milestones that support the department’s Authority To Operate through the CNA processes. • For a CNA requirement, I implemented the changes in the Windows, IIS, and SQL Server logging to capture sufficient application data to be used to support after the fact investigations. • Determined the processes and tools to be used to secure external media encryption. • Developed and tested the server contingency plan for the WDS server enclave. • Process the personnel gains and losses report for any departing or transferring personnel. This is a weekly report. • Dynamically collaborated with another administer to upgrade our web servers from Windows Server 2003 to 2008 R2 and our SQL Servers to Windows Server 2012. This included migrating the IIS & SQL settings and data. • When newer browsers and security settings were implemented, I discovered a solution to fix the display and interaction with some form pages in the EFAS application. • Created a ticket tracking website for our group to track and reference DOE tickets submitted for server and other issues that required...

Words: 584 - Pages: 3

Premium Essay

NT1330 Unit 1 Assignment 1

...The world is changing fast. At the end of 2015, nearly 44% of the world population had access to the internet. 1 By some reliable estimates, the remaining 56% of the world’s population will be connected to the vast digital network by 2025. 2 In less than nine years, every human will have the potential to be connected to another, no matter the physical separation. This makes online privacy a particularly critical endeavor, placing privacy professionals at the center of a critical mass of initiatives, services, responsibilities, and leadership. For example, the scale of the U.S. federal government’s digital and information technology mission is staggering, as the U.S. federal government represents a North Star to so many private and public institutions, the leadership and knowledge of privacy professionals working in our government can impact the privacy and technology landscape in ways that are orders of magnitude larger than they would be in other institutions. 3 The impact of many private entities that operate in the collection and processing of data also have an enormous impact on how notions of privacy are shaped.4...

Words: 469 - Pages: 2

Premium Essay

Nt1330 Unit 1 Assignment 1

...1.1 System Analysis In these days computing becomes online. A direct client-server method is simple and economically better for small business units. But, if there is only a single server mandatory to serve every request simultaneously then therewillbe a chance of data loss, data corrupt and process delay. To attend a request in a proper manner a single server will take more time which will lead it to traffic and congestion. Cloud Computing gives solution for these problems. By using several servers in the cloud user can access the data from any available server in the group. As like every other systems this cloud computing has its own flaw, which here the Data Efficiency is well improved but data security is in threat. As the user don’t know the origin of the data, server and other services except the screen what they can access they may fall into cyber crime....

Words: 350 - Pages: 2

Premium Essay

Nt1330 Unit 1 Assignment 1

...List of Tables and Figures List of Tables Page 1. Table 1 Some of the DBA Exams and Numbers with their Certifications 18 2. Table 2 Different DBA Jobs with their Skills Required, Experience and Location 24 3. Table 3 DBA Jobs from Different Companies 25 4. Table 4 DBA Job Description 27 5. Table 5 DBA Certification with Exams 33 List of Figures 1. Figure 1 Number of jobs, in DBA in United States 38 2. Figure 2 Shows the average salary for different DBMS jobs 39 Introduction Since decades, database management has had a prominent position in the field of IT. It mainly deals with the maintenance and operation of the databases of business services. Currently I have enrolled in master’s program in information assurance which is the combination of business assurance and information technology. It covers the core topics like networking, database management and security of systems for business organizations. I am strongly determined to work as a database administrator for an organization. A database is...

Words: 1799 - Pages: 8

Premium Essay

Nt1330 Unit 1 Assignment 1

...The growth of the cloud has resulted in opportunities to partner with external organizations including vendors, suppliers, and industry groups for the purpose of providing enhanced access to resources hosted across the partnerships. The existing infrastructure does however present several challenges to implementing streamlined resource access including: 1- Exchanging user information between partners in a secure fashion. 2- Establishing a link between a user identity at a Partners 3- Enabling single sign-on between Partner Web sites. 4- Providing single logout (SLO) between Partner Websites. 5- Controlling access to resources based on partners user identity. 6- Inability to leverage disparate identity infrastructure across environments such...

Words: 817 - Pages: 4

Premium Essay

Nt1330 Unit 1 Assignment 1

...There are multiple changes that occurred to the test server I deployed after installing SQL Server 2012. This summary will analyze those changes and list the steps taken to review these changes. To properly list these changes, an overview will first be taken prior to the installation followed by an examination of anything different after the install. The test server was setup with a fresh install of Server 2008 R2 and all appicable updates. The only other software that was installed was the .NET Frameworkj necessary as a prerequisite for the SQL Server 2012 install. The only directory in the Program Files folder that is not from the install is the VMware folder due to the fact I am using VMware Workstation Player for my test installation. There are also only 39 processes running in the task manager. Upon completion of the SQL Server 2012 installation, one of the first changes is noticed in both the Program Files and the Program Files (x86) directories in the root of the C drive. These both now contain a directory labeled Microsoft SQL Server containing all of the necessary components to run the new SQL installation. There are also now 43 processes running in the task manager which can be seen by right clicking on the task bar, selecting task manager, and selecting the processes tab. In the description, you can see 4 new processes related to SQL Server that are consuming resources. There are also two new folders seen when the Start menu is accessed. These are seen when clicking...

Words: 454 - Pages: 2