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
0
votes
0 answers

Opening MySQLConnection on localhost very slow. Using .Net connector

I'm trying to learn to use C# with Visual Studio 2015 and the MySqlConnection.Open() method is taking over 15 seconds to establish the connection. The program I've written simply establishes the connection and displays a message confirming connected…
DMcDonald
  • 89
  • 1
  • 14
0
votes
2 answers

Can't connect to MySQL Database in phpBB

I am trying to connect to a MySQL database using the mysql_connect() command however I keep getting the error message: Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying…
Doug
  • 119
  • 1
  • 11
0
votes
1 answer

Socket.io and MySQL Connections

I'm working on my first node.js-socket.io project. Until now i coded only in PHP. In PHP it is common to close the mysql connection, when it is not needed any more. My Question: Does it make sense to keep just one mysql-connection during server is…
AppGeer
  • 725
  • 1
  • 11
  • 27
0
votes
1 answer

Sql connection refused for PHP class

If I use simple SQL-PHP connection to test if it can connect to DB like: $link = mysql_connect('localhost', 'user', 'pass'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected'; mysql_close($link); It works and connects…
user3350179
0
votes
1 answer

Converting large web applications from mysql_connect to PDO usage

I got an assignment to create a new server environment. My boss decided to switch to a new version of PHP, what I encouraged. I just installed PhpMyAdmin on the new server and got a warning that the mqsql_connect function is deprecated. I understand…
JKL
  • 978
  • 7
  • 21
0
votes
1 answer

mysql_connect not working after EasyApache update

I am running out of ideas here and hoping someone can help me out. I am using WHM, and used the EasyApache to enable zip. Upon completion all my mysql_connect statements stopped working. So running a basic piece of code like:
Kyle
  • 164
  • 13
0
votes
1 answer

Already using my username and password.Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: NO)

if(!empty($_POST["save"])) { $conn = mysql_connect("localhost","root",""); mysql_select_db("admin"); $itemCount = count($_POST["item_name"]); $itemValues=0; $query = "INSERT INTO item (item_name,item_price) VALUES "; $queryValue = ""; …
0
votes
0 answers

MySQL 6.3 Workbench Connectivity Issues

I'm long been away from MySQL I'm having connectivity issues in establishing connection with my localhost I also added System32 folder to my PATH variable. What could I be missing?
0
votes
1 answer

MySQL Stored Proc and c# data reader column wrong values

I have a situation in such a way that variable value has to be returned based on multiple condition. Initially it is set to passed parameter value. Below is just an algo, create proc checkFlag (ppleid int, pflag bit, loginid int) …
0
votes
1 answer

After migrate magento to newer server with SQLi and PHP5.5 module can't connect database

After migrate magento the shop works fine but when I want to pay the redirect doesn't work and got fatal error. In log file the following error appeared: ERR (3): Deprecated functionality: mysql_connect(): The mysql extension is deprecated and…
0
votes
1 answer

How do I fix the "Fatal error: Call to undefined function mysqli_connect()" error?

I'm trying to create a database using PHP and MySQL but keep getting an error: "Fatal error: Call to undefined function mysqli_connect()". I've looked around and have seen and tried implementing the suggested fixes: I have uncommented the…
NZerker
  • 1
  • 5
0
votes
2 answers

PHP mysql_connect with false variable

.Hello, I'm reading through some code and am not sure if I'm understanding this fully. This is supposed to connect to a mysql database: if (!$dblink[$dblinkname] = mysql_connect($dbhost, $dbuser, $dbpass, true)) { //Throw error message …
mario
  • 1,503
  • 4
  • 22
  • 42
0
votes
0 answers

convert mysql_connect to joomla-based connect

I have been struggling with this for a couple days now, but can't get it to work. I'm currently building a website in Joomla and added a puzzle-game page into it. What I want to do is, save the time-score and create a simple top-10 score list. I got…
0
votes
0 answers

On PHP, about using mysql or mysqli

I'm running MySQL server version 5.0.77 on Linux (Rocks Cluster Distro), and I'm trying to connect to the same database with both MySQL and MySQLi PHP functions. The problem is that when the MySQLi code fragment is executed it does work, but the…
Will Rar
  • 1
  • 1
0
votes
1 answer

MySql connection from c# .NET console application doesnt return

I am attempting to connect to a remote MySQL database in a C# .NET console application. When my code executes the connection.open() method the debugger never returns to the next line. I am not sure if there is just horrible lag, or if the connection…
user2512589
  • 103
  • 1
  • 1
  • 6