Foros del Web » Programando para Internet » PHP »

Ayuda al novato

Estas en el tema de Ayuda al novato en el foro de PHP en Foros del Web. por favor ayudenme con PHPMYADMIN, me he creado una cuenta en 000webhost y tambien en phpmyadmin, nose donde colocar el string de la conexion en ...
  #1 (permalink)  
Antiguo 24/01/2009, 16:17
airknightz
Invitado
 
Mensajes: n/a
Puntos:
Ayuda al novato

por favor ayudenme con PHPMYADMIN, me he creado una cuenta en 000webhost y tambien en phpmyadmin, nose donde colocar el string de la conexion en esta pagina y tampoco como jalar los datos, si alguien lo puede resolver le estare muy agradecido OK

MI web es: http://omark1988.comoj.com/omark1.html

Y SU CODIFICACION ES:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<style type="text/css">
<!--
body {
background-image: url(NejikiPlatinum.gif);
}
.Estilo3 {
font-family: "MS Gothic";
font-weight: bold;
font-style: italic;
}
-->
</style></head>

<body>
<form id="form1" name="form1" method="post" action="">
<table width="1184" border="1">
<tr>
<td colspan="5"><span class="Estilo3">UNA WEB CON FUTURO PROMETEDOR</span></td>
</tr>
<tr>
<td width="23">&nbsp;</td>
<td width="35">&nbsp;</td>
<td width="35">&nbsp;</td>
<td width="35">&nbsp;</td>
<td width="1022">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
  #2 (permalink)  
Antiguo 24/01/2009, 16:33
airknightz
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: Ayuda al novato

Cita:
Iniciado por airknightz Ver Mensaje
por favor ayudenme con PHPMYADMIN, me he creado una cuenta en 000webhost y tambien en phpmyadmin, nose donde colocar el string de la conexion en esta pagina y tampoco como jalar los datos, si alguien lo puede resolver le estare muy agradecido OK

MI web es: http://omark1988.comoj.com/omark1.html

Y SU CODIFICACION ES:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<style type="text/css">
<!--
body {
background-image: url(NejikiPlatinum.gif);
}
.Estilo3 {
font-family: "MS Gothic";
font-weight: bold;
font-style: italic;
}
-->
</style></head>

<body>
<form id="form1" name="form1" method="post" action="">
<table width="1184" border="1">
<tr>
<td colspan="5"><span class="Estilo3">UNA WEB CON FUTURO PROMETEDOR</span></td>
</tr>
<tr>
<td width="23">&nbsp;</td>
<td width="35">&nbsp;</td>
<td width="35">&nbsp;</td>
<td width="35">&nbsp;</td>
<td width="1022">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
Nota ya he creado mi base de datos en phpmyadmin solo quiero jalar esos datos ami web.
  #3 (permalink)  
Antiguo 25/01/2009, 00:47
Avatar de jfl_freak  
Fecha de Ingreso: enero-2009
Ubicación: Guatemala
Mensajes: 96
Antigüedad: 15 años, 3 meses
Puntos: 1
Respuesta: Ayuda al novato

Bueno primero deberías de leer siempre el manual de php de su página oficial

Acá esta un ejemplo para crear tu cadena de conexión

Código PHP:
<?php
$link 
mysql_connect('localhost''mysql_user''mysql_password');
if (!
$link) {
    die(
'Could not connect: ' mysql_error());
}
echo 
'Connected successfully';
mysql_close($link);
?>
Localhost es la dirección IP de tu website, mysql_user sería el usuario que mencionas y mysql_password sería el pass de esa cuenta.

Ahora deberías de investigar un poco como hacer llamadas a librerías y como cargar los datos de tu base de datos:

Código PHP:
<?php

include("connectionDB.php");

// connect to db
$conectar connect();

$queEmp "SELECT * FROM estudiante";
$resEmp mysql_query($queEmp) or die(mysql_error());
$totEmp mysql_num_rows($resEmp);

if (
$totEmp0) {
    while (
$rowEmp mysql_fetch_assoc($resEmp)) {

        
$nombre1 $rowEmp['nombre1'];
        
$nombre2 $rowEmp['nombre2'];
        
    }
}


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>
Emergency Contact and Medical Information
</title>

<!-- Meta Tags -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

</style>
</head>

<body>
<input    name="nombre1"     type="text" value="<?php echo $nombre1?>" />

<input  name="nombre2"  type="text" value="<?php echo $nombre2?>" />
</body>
</html>
Y un consejo sano, investiga!!!!! En la web hay una infinidad de este tipo de ejemplos.

Saludos
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 18:33.