Paulo Mamao Posted February 19, 2012 Report Share Posted February 19, 2012 sistema de os<?php# FileName="Connection_php_mysql.htm"# Type="MYSQL"# HTTP="true"$hostname_data = "localhost";$database_data = "data";$username_data = "";$password_data = "";$data = mysql_pconnect($hostname_data, $username_data, $password_data) or trigger_error(mysql_error(),E_USER_ERROR); ?>Onde esta o erro?Esta aparecendo assim: No database selected Quote Link to comment Share on other sites More sharing options...
0 mJi Posted February 19, 2012 Report Share Posted February 19, 2012 Prefira mysql_connect() a mysql_pconnect(). Use a segunda apenas em casos em que a mesma se faz necessária.Você faz alguma coisa no código depois dessa parte?O que está faltando é selecionar o banco de dados. Um servidor SQL pode possuir vários bancos de dados. Para selecionar, use mysql_select_db. Quote Link to comment Share on other sites More sharing options...
0 ESerra Posted February 19, 2012 Report Share Posted February 19, 2012 Movendo Repositório de Scripts - PHP » PHP. Quote Link to comment Share on other sites More sharing options...
0 Marcos Basso Posted February 20, 2012 Report Share Posted February 20, 2012 sistema de os<?php# FileName="Connection_php_mysql.htm"# Type="MYSQL"# HTTP="true"$hostname_data = "localhost";$database_data = "data";$username_data = "";$password_data = "";$data = mysql_pconnect($hostname_data, $username_data, $password_data) or trigger_error(mysql_error(),E_USER_ERROR); ?>Onde esta o erro?Esta aparecendo assim: No database selectedEstá faltando a linha:mysql_select_db($database_data, $data); Quote Link to comment Share on other sites More sharing options...
Question
Paulo Mamao
sistema de os
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_data = "localhost";
$database_data = "data";
$username_data = "";
$password_data = "";
$data = mysql_pconnect($hostname_data, $username_data, $password_data) or trigger_error(mysql_error(),E_USER_ERROR);
?>
Onde esta o erro?
Esta aparecendo assim: No database selected
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.