Questions tagged [mysql-connect]

The `mysql_connect` function opens a connection to a MySQL server.

The mysql_connect function opens a connection to a MySQL server. However, this function, along with all other mysql_* functions, are deprecated in PHP 5.5.0 and should be avoided (see the red box). Consider using prepared statements with either PDO or MySQLi instead.

192 questions
4
votes
5 answers

Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known

I'm trying to connect to a localhost database using php. but it's shown Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\xampp2\htdocs\wikifiesto\wf-insertcase.php on line 7 Warning:…
sang
  • 375
  • 2
  • 8
  • 23
4
votes
4 answers

keeping db connection active across pages

I'm a learner. Is there a way to stay connected in to the mysql database as the user is taken to the next page. For example, the db connection is made, the user is logged in, and then goes to the next page to access a table in the database. …
dave
  • 1,041
  • 2
  • 12
  • 18
4
votes
1 answer

PDO cant connect, but mysql_connect can (without PW)

I'm really having a strange Issue here, and it's really starting to annoy me. It's about the different behaviour of connections. I'm just trying to set up CakePHP, but the PDO cant conenct to the mysql Server. Okey, step by step: It's a fresh…
Katai
  • 2,773
  • 3
  • 31
  • 45
3
votes
2 answers

why would mysql_connect randomly not work?

I have mysql_connect running with no problem on my site... I have a script that i'm running from a CRON job, and here it decides to not work, and output these two errors: PHP Warning: PHP Startup: Unable to load dynamic library…
Shackrock
  • 4,601
  • 10
  • 48
  • 74
3
votes
2 answers

php mysql_connect resource is allways the same

I'm having a problem my php script witch you can see here: http://codepad.org/F0qhElRC Is not opening a new resource for each connection from a child. Already I tryed using 127.0.0.1 or my local network IP but nothing worked, also…
Fernando André
  • 1,213
  • 3
  • 19
  • 32
3
votes
0 answers

How to connect AWS RDS with AWS Lambda in Python - Mysql-connect

I have written a python script that connects to my AWS RDS database extracts some data, performs some webscraping tasks and then imports the results back to AWS RDS. Currently this works perfectly fine locally but I would now like to upload the code…
brian4342
  • 1,265
  • 8
  • 33
  • 69
3
votes
3 answers

Do I need to be concerned about password in mysql_connect in php?

When writing out the connect code to the database isn't it wide open for anyone to view my database username and password? Couldn't they then connect and alter my database? It just seems strange to type out my username and password and not be…
m1xolyd1an
  • 535
  • 5
  • 18
3
votes
1 answer

Too Many Connections - MySQL - 2GB RAM

My server having 2GB of RAM and max_connections variable is set to 100. The website is an active website and having plenty of traffic, and I expect more than 100 users simultaneously using the website and all of these simultaneous users will must…
Gulfam
  • 558
  • 6
  • 27
3
votes
4 answers

PHP - Best way to connect to database when there are multiple connections

I have just recently acquired the service side of a medium size project. The former developer has all of his functions as separate php scripts instead of classes (func1.php, func2.php, etc)... All these 'functions' make a reference to mysqli_connect…
dudemanbearpig
  • 1,264
  • 3
  • 12
  • 19
3
votes
5 answers

How to insert data in two different tables of two different database in php

I have to insert data in two different database's table. I have created database1 and table1 for database1, also i have created database2 and table2 for database2. For inserting data i have written code, $connect =…
M Gaidhane
  • 531
  • 8
  • 29
3
votes
1 answer

Can't connect to mysql using Bitnami lamp stack through php

Ok, this will be a long question. I'm trying to get something up and running on my university account. We have a public_html folder that we can use as web space to host anything we want there. I've installed Bitnami lamp stack in the public_html…
MikiRei
  • 33
  • 1
  • 4
3
votes
3 answers

Excel VBA connect to MySQL - architecture mismatch error

I am trying to connect to MySQL from my local machine located on a server using VBA. Initially I was receiving the below error. [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. After some research, I…
Ramesh
  • 765
  • 7
  • 24
  • 52
2
votes
1 answer

Twisted web service - sql connection drops

I am working on a web service with Twisted that is responsible for calling up several packages I had previously used on the command line. The routines these packages handle were being prototyped on their own but now are ready to be integrated into…
DeaconDesperado
  • 9,977
  • 9
  • 47
  • 77
2
votes
1 answer

PHP: mysql_connect not returning FALSE

I have a form where the user enters their database information and can click a link that uses AJAX to send the credentials to this page. The problem I have is that as long as they enter the correct host name the script returns TRUE. Is there another…
Robert
  • 69
  • 8
2
votes
2 answers

Whats wrong with my PHP include for database connection?

Im trying to move my database connection script to an external (and therefore more secure) file. However, it isnt working. Here my PHP page (with include link)
Jonah Katz
  • 5,230
  • 16
  • 67
  • 90
1
2
3
12 13