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
1 answer

UKHost4U and MySQL - How to connect?

been waiting an hour to find out correct way to connect to mysql at UKHOST4U, thought someone on here may know? Been using the following code, database, user & password are all setup…
Chris
  • 81
  • 12
0
votes
5 answers

mysql_connect() always denies access

I have phpMyAdmin running with MAMP, and I am finding it impossible to use mysql_connect(). $_db_connect = mysql_connect("root", "localhost"); Produces an error in php_error.log: mysql_connect() [
kingkong
  • 13
  • 1
  • 1
  • 3
-1
votes
2 answers

Unable to connect to mysql database using PHP script

I have two databases on mysql server 'application' and 'test'. I am trying to connect to 'application' db using the following code
Raviteja Reddy
  • 109
  • 2
  • 14
-1
votes
2 answers

executing "php -r" mysql_connect() not returning link resource

I've been embedding some php in my shell scripts. Stuff like this works: SUBJECT_URL=php -r "echo rawurlencode('$SUBJECT');" and sets my string variable SUBJECT_URL to the converted value of $SUBJECT However, I am trying to use this…
jim
  • 1
  • 1
-1
votes
1 answer

Update depreciated mysql_connect()

I have the following php code connecting my database with mysql_connect(), but I keep getting the following warning: Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in…
K Ghumaan
  • 97
  • 7
-1
votes
2 answers

PHP mysql_connect fails, PDO connection to MySQL works fine

The pdo connection to the sql server works fine, here is the code: try { $host = "tcp:hdl324kjh.database.windows.net, 1433"; $user = "user@hdl324kjh"; $pwd = "password"; $db = "my_db"; $conn = new PDO ("sqlsrv:Server = $host;…
user2672112
  • 199
  • 1
  • 14
-1
votes
3 answers

PhP not connecting to MySQL

Trying to connect to MySQL using this code
Craig
  • 364
  • 1
  • 3
  • 25
-1
votes
1 answer

PHP - What is the "data type" of $link in this case? $link = mysql_connect()

Disclaimer While I know the mysql_[command] functions are depreciated, this is for a school project and I started before they became depreciated. I don't get marked on the "up-to-date-ness" of the functions used, only the complex-nature of the…
Justice
  • 169
  • 1
  • 2
  • 9
-1
votes
1 answer

MySQL connection error: resource(2) of type (mysql link)

I have this problem:
dio_bless
  • 435
  • 2
  • 5
  • 13
-1
votes
5 answers

resource in mysql_connect in php

I am trying to connect to database through php.I did it lots of time. But I want to know how many rows exist in my table. I've tried to use php manual, however, I was confused. $link = mysql_connect("localhost", "mysql_user",…
AMiSH13
  • 97
  • 3
  • 8
-1
votes
1 answer

How do I create a mysql LIKE variable?

Is it possible to create a variable in MySql for a LIKE expression? ex. SET @test = '%my text to look for%'; SELECT * FROM MYTABLE WHERE MYCOLUMN LIKE @test; Of course I tried this approach and it did not work. Sorry for choosing the mysql-connect…
Steven Combs
  • 1,890
  • 6
  • 29
  • 54
-1
votes
1 answer

cmake "Cannot find MySQL" (using XAMPP)

I'm using XAMPP to install and run MySQL, and when I run me@host:/path/to/mysql-connector-cpp> cmake ., it throws -- BOOST_INCLUDE_DIRS=/usr/local/include -- ENV{MYSQL_DIR} = CMake Error at FindMySQL.cm:202 (MESSAGE): mysql_config wasn't found,…
user1116999
-1
votes
1 answer

mysql_connect - Access Denied to DB or DB doesn't exist?

So I connect to my MySQL database using the following code: function dbConnect($h,$u,$p,$n) { if (!$con = @mysql_connect($h,$u,$p)) {$err = err("There is a problem connecting to the database. ".mysql_error());} else if…
Err
  • 890
  • 2
  • 11
  • 32
-2
votes
1 answer

mysqli_connect executing for every host input

mysqli_connect or die functions working together fine in case of the both correct and incorrect host names.But no matter…
-2
votes
1 answer

Access denied for user 'test123'@'192.168.0.38' (using password: NO)

I want to run this code on byethost31.com (free hosting site) so i am facing " Access denied for user 'test123'@'192.168.0.38' (using password: NO)" Error on console.. …
SUM
  • 23
  • 1
  • 10
1 2 3
12
13