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
1
vote
2 answers

how to insert data in database using textarea in php?

i am using text area in my code to insert data in database. but there is some confusion in my code. when i click at submit button, text in textarea disappear and not saved in database. this is my Code. Form Coding:
Alvi
  • 123
  • 1
  • 3
  • 14
1
vote
0 answers

mysql_close and mysql_pconnect not working

I have this scenario: [ file: config.php ] $conn=mysql_connect(... mysql_select_db [ file: function.php ] include('db.php'); function a() { mysql_query("INSERT INTO..."); } [ file: index.php ] include('function.php'); a(); mysql_close($conn); in…
Helixior
  • 55
  • 1
  • 4
1
vote
1 answer

I cannot see utf8mb4 characters from my database with cmd on windows

This is how I connect to my database on my Windows cmd: mysql -u mydb -h myip -p. It has always worked since I tried to swap my utf8 database to utf8mb4. The changes I apply with php or java work fine and I can see those characters correctly when…
danibg
  • 214
  • 1
  • 15
1
vote
0 answers

fork + PHP CodeIgniter: 'MySQL server has gone away' - How not to lose connection when forking with CI?

I installed fork on my Ubuntu Server (using PHP-Apache-Codeigniter). I have this code: input->post('key_word'); $prod = $this->input->post('prod_name'); $prod =…
Imnotapotato
  • 5,308
  • 13
  • 80
  • 147
1
vote
2 answers

Establish connection to a database

I've installed a LAMP server in a Oracle VM VirtualBox using Ubuntu 14.0 desktop recently so I could learn about PHP interactions with MySQL databases. I cannot establish a connection with my database. It doesn't give any error messages even if I…
MuriloRM
  • 59
  • 1
  • 11
1
vote
0 answers

Connect to second database in another MySQL server

I have a system in Bluehost which I could connect easily to the database with $con = new_mysqli("localhost", "username", "password", "database"); But I'm also trying to establish a second connection, but not in the Bluehost, but in a local server…
1
vote
0 answers

How many connections / second before a MySQL database becomes unstable?

I'm developing an app that downloads and uploads an average of 10KB every 60 seconds. All within a single connection / second thanks to my supreme engineering. :) Each instance of the app opens and closes a new connection every 60 seconds but…
Nick Keroulis
  • 133
  • 1
  • 6
1
vote
2 answers

PHP Select SQL view no output

I creating a php file that pulls a view from an SQL database. Can someone let me know why this isn't working? It seems to be timing out. I am not getting a connection error, either. Thank you in advance.
Kripros
  • 33
  • 1
  • 5
1
vote
1 answer

Failed to connect mysql in centos 6.5

I'm using php-mysql-apache in centos 6.5 system all requirements are exists, i think i can publish my html files in localhost but when i try to connect to mysql in php script. It doesn't appear and it shows mysql connection error. # rpm -qa |grep…
seylul
  • 61
  • 7
1
vote
2 answers

Warning: mysql_connect(): No connection could be made because the target machine actively refused it

I am using SQLplus and zend server. When I try to run config.php, I get the error. I dont know whats causing it. This the code of config.php
el323
  • 2,760
  • 10
  • 45
  • 80
1
vote
2 answers

mysql connecting to remote host fails

In my script on de webserver I'm trying connect to mysql through the (good old) mysql_connect() to an ip (db server) in the same network. MySQL keeps throwing me the error: Access denied for user ''@'localhost' to database 'dbname' This seems like…
1
vote
1 answer

Connecting to clearDB mysql database from php Azure application using MySQL_connect

I have deployed a php website to azure. It has a connection string like this: $host = 'localhost'; $username = 'xxxxx'; $password = 'xxxxx'; $database = 'xxxxx'; $con = mysql_connect($host, $username, $password); I need to change this when…
Linda Keating
  • 2,215
  • 7
  • 31
  • 63
1
vote
0 answers

Why have I got MySQL sleeping connections when not using mysql_pconnect()

An Apache Bench test revealed that high throughput on the database caused the following... Apache threads stuck in "Sending Reply" state, all related to a particular PHP file (as seen in Apache extended status). MySQL sleeping connections with the…
Chris Rosillo
  • 313
  • 3
  • 8
1
vote
4 answers

Mysql-cluster issue

I am trying to create a table in mysql Cluster. When I type this I had this error: /usr/local/mysql/mysqlc/bin/mysql -h 127.0.0.1 -P 1186 -u root ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Someone has…
1
vote
4 answers

Public IP Address as my hostname in mysql_connect()

i want to connect my php application(here at my office) and my database is at my home, mysql_connect('119.92.59.55','root','lester1992') but they don't communicate each other(my comp & my office terminal), what maybe the posible problem? here is…
Lester1992
  • 493
  • 2
  • 9
  • 20