Foros del Web » Programando para Internet » PHP »

PHP & MySQL

Estas en el tema de PHP & MySQL en el foro de PHP en Foros del Web. bueno mi pregunta es como se debe configurar correctamente mysql para que desde un script en php colocado en mi hosting pueda mostrar datos de ...
  #1 (permalink)  
Antiguo 13/04/2009, 09:56
 
Fecha de Ingreso: septiembre-2008
Mensajes: 101
Antigüedad: 15 años, 6 meses
Puntos: 4
Pregunta PHP & MySQL

bueno mi pregunta es como se debe configurar correctamente mysql para que desde un script en php colocado en mi hosting pueda mostrar datos de una database en mi pc espero que allan comprendido espero una repuestas gracias de antemano...
  #2 (permalink)  
Antiguo 13/04/2009, 10:03
 
Fecha de Ingreso: febrero-2009
Ubicación: cancun!
Mensajes: 898
Antigüedad: 15 años, 2 meses
Puntos: 15
Respuesta: PHP & MySQL

$hostname_bd = "192.168.nn.nnn:3306";
$database_bd = "nombre";
$username_bd = "usuario";
$password_bd = "pass";
$bd = mysql_pconnect($hostname_bd, $username_bd, $password_bd) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($database_bd, $bd);

entiendo que la base de datos es remota
asegurate de añadir al usuario en mysql
y dale los permisos correspondientes
saludines!!1
__________________
WHERE IS MY BLUE SUNNY SKY??
pd: todos los karmas son bienvenidos :D
  #3 (permalink)  
Antiguo 13/04/2009, 10:04
Avatar de duskrow  
Fecha de Ingreso: abril-2008
Mensajes: 267
Antigüedad: 16 años
Puntos: 8
Respuesta: PHP & MySQL

creo que tienes que explicarte un poco mejor :)
  #4 (permalink)  
Antiguo 13/04/2009, 11:00
 
Fecha de Ingreso: septiembre-2008
Mensajes: 101
Antigüedad: 15 años, 6 meses
Puntos: 4
Respuesta: PHP & MySQL

exelente lo que respondio mi amigo harvestmoon pero eso siempro lo ago pero lo delos permisos se los asignos a un use pero nunca se conecta siempre muere la coneccion aguna idea de que pueda ser?
  #5 (permalink)  
Antiguo 13/04/2009, 11:04
 
Fecha de Ingreso: febrero-2009
Ubicación: Cusco - Peru
Mensajes: 142
Antigüedad: 15 años, 2 meses
Puntos: 0
Respuesta: PHP & MySQL

tu hostin es tu misma pc, o eske tratas de conectarte a un hosting externo??
  #6 (permalink)  
Antiguo 13/04/2009, 11:07
 
Fecha de Ingreso: febrero-2009
Ubicación: cancun!
Mensajes: 898
Antigüedad: 15 años, 2 meses
Puntos: 15
Respuesta: PHP & MySQL

muere la conexion?
te marca algun error
ou por q no intentas aumentar el tiempo de ejecucion en tus sript
esta en el php.ini
saludines!!
__________________
WHERE IS MY BLUE SUNNY SKY??
pd: todos los karmas son bienvenidos :D
  #7 (permalink)  
Antiguo 13/04/2009, 11:18
 
Fecha de Ingreso: septiembre-2008
Mensajes: 101
Antigüedad: 15 años, 6 meses
Puntos: 4
Respuesta: PHP & MySQL

osea no se conecta el script me dise que no se pudo conectar con la base de dato
  #8 (permalink)  
Antiguo 13/04/2009, 11:27
 
Fecha de Ingreso: febrero-2009
Ubicación: cancun!
Mensajes: 898
Antigüedad: 15 años, 2 meses
Puntos: 15
Respuesta: PHP & MySQL

y el mysql_error()
que te muestra
algun codigo de error?
de autentificacion
te dice algo del password o del user
manda todo lo q marke saludines!!
exito!
__________________
WHERE IS MY BLUE SUNNY SKY??
pd: todos los karmas son bienvenidos :D
  #9 (permalink)  
Antiguo 13/04/2009, 15:33
 
Fecha de Ingreso: septiembre-2008
Mensajes: 101
Antigüedad: 15 años, 6 meses
Puntos: 4
Respuesta: PHP & MySQL

bueno es un script prefrabicado lo unico que me pide es una base de datos un usuario un host no coloco la database en el hosting porque corre de la mano con una aplicacion la cual exige una gran cantidad de recursos. el error que dise es qu no se conecta con la base de datos

Código:
<?php

defined( '_ACM_VALID' ) or die( 'Direct Access to this location is not allowed.' );

define ('DEBUG', false);								// Enable debug mode ; for set on replace false by true
define ('LOG', false);									// Enable log mode ; for set off replace true by false

//	#	Login Server Configuration

$ls_host		= '190.207.153.97';							// login host database DB
$ls_user		= 'arkang31';								// login user
$ls_pass		= '1234';									// login password
$ls_db			= 'l2jdb';								// login database name

//	#	Game Server Configuration

$id = 1;												// Id of the game server
$gs_host[$id]	= '190.207.153.97';							// game host database DB
$gs_user[$id]	= 'arkang31';								// game user
$gs_pass[$id]	= '1234';									// game password
$gs_db[$id]		= 'l2jdb';								// game database name

/**

Copy line under this text for add a new world. The id need to be same as the id registred into gameservers table.

$id = 2;												// Id of the game server
$gs_host[$id]	= 'localhost';							// game host database DB
$gs_user[$id]	= 'root';								// game user
$gs_pass[$id]	= '';									// game password
$gs_db[$id]		= 'l2jdb';								// game database name

*/

//	#	Web Configuration

$server_name	= 'Private Server';						// server name
$email_from		= '[email protected]';					// Specify an adress email source

$act_img		= true;									// Activate image verification ; set false if you want desactivate
$act_email		= true;									// Activate email verification ; set false if you want desactivate

$acc_limit		= false;								// How many account can be registered ; set false for unlimited

$same_email		= false;								// Allowed same email for different account ; set false if you want prohibit

$id_limit		= 15;									// Limit id characters
$pwd_limit		= 15;									// Limit pwd characters

$language		= 'english';							// language use by Account Manager :: name of language file in language folder

$can_chg_email	= false;								// User can change email ; set false if you want prohibit (If there are no email registered. Option is avaible same if you have set prohibited)

$ack_cond		= false;								// User must accept before register :: conditions can be edited on language file

$template		= 'kamael';								// template directory


//#####################
//# Characters Config #
//#####################

// Don't use those settings for now keep to false please

$allow_char_mod				= false;					// Enable characters mod
$allow_account_services		= false;					// Enable Account services feature (change name and gender) for offline character
$time_account_services		= 7;						// Need to wait 7 days after change gender before to change another time for the same or another character
$item_female_only			= array(8559,8913,8917);	// Check female-use only items before to change gender
$item_male_only				= array(8923);				// Check male-use only items before to change gender
$name_regex	= '`^[[:alnum:]]{3,16}$`';					// allow alphanumeric character in char name (3-16 char.)

$allow_fix					= false;					// Enable fixing feature for offline character
$allow_unstuck				= false;					// Enable unstuck feature for offline character
$time_fix					= 24;						// Need to wait 24 hours before to use fix or unstuck against
$coord_static				= false;					// Use static coords when using unstuck and fix feature
$coord_default				= array(0,0,0);				// When coord static enable tp player to the coords (x,y,z)

//###################
//# Advanced Config #
//###################

$smtp['use']		= false;							// Set to true if you want use an smtp server
$smtp['address']	= 'smtp.server.com';				// Address of the smtp server
$smtp['port']		= 25;								// Port of the smtp server
$smtp['login']		= '';								// login of the smtp server if you need authentication
$smtp['password']	= '';								// password of the smtp server if you need authentication
$smtp['domain']		= '';								// domain of your host

$id_regex	= '`^[[:alnum:]]{4,'.$id_limit.'}$`';		// allow alphanumeric character in login name and login character min needed is 4
$pwd_regex	= '`^[[:alnum:]@\\\/]{4,'.$pwd_limit.'}$`';	//allow alphanumeric character and \ / @ in password and pwd character min needed is 4

?>
  #10 (permalink)  
Antiguo 13/04/2009, 15:40
 
Fecha de Ingreso: febrero-2009
Ubicación: cancun!
Mensajes: 898
Antigüedad: 15 años, 2 meses
Puntos: 15
Respuesta: PHP & MySQL

$ls_host = '190.207.153.97';

doble comilla
y no le has puesto el puerto por el cual debe entrar
saludines!
__________________
WHERE IS MY BLUE SUNNY SKY??
pd: todos los karmas son bienvenidos :D
  #11 (permalink)  
Antiguo 13/04/2009, 16:55
 
Fecha de Ingreso: septiembre-2008
Mensajes: 101
Antigüedad: 15 años, 6 meses
Puntos: 4
Respuesta: PHP & MySQL

uhhh? pero no lo piede el script que modificaciones deberia hacer para que funcione
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:02.