Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/11/2012, 08:03
cesar_lanzi
 
Fecha de Ingreso: noviembre-2012
Mensajes: 2
Antigüedad: 11 años, 6 meses
Puntos: 0
conectar a SQL Server 2008

Estimados,
Ante todo me presento, soy nuevo en este lenguaje, antes desarrolle en VB5 y 6, gx9

Tengo montado un servidor sql2008 y al probar este código:

<?
//coneccion.
$conection = mssql_connect("localhost\dbinstance","sa","sotreta ") or die("no se puede conectar a SQL Server");

//DB
mssql_select_db("Capacitacion",$conection);

//table
$SQL = "SELECT * FROM CLI01";

//

?>

<html>
<head>
<title>Conexion mssql</title>
</head>
<body>

<table border="1" cellspacing="3" cellpading="3">

<tr>

<td>Cliente ID</td>
<td>Cliente Nombre</td>
<td>Suplier ID</td>
<td>Category ID</td>
<td>Quantity per Unit</td>
<td>Unit Price</td>

</tr>

<?

$result = mssql_query($SQL);

while($row = mssql_fetch_array($result)){

?>

<tr>

<td> <? echo $row['CLI01NumCli'] ?> </td>
<td> <? echo $row['CLI01NomCli'] ?> </td>

</tr>

<?

}

?>

</table>

<?

mssql_close($conection);

?>
</body>
</html>



no logro que PHP muestre los datos de la tabla en cuestion, tampoco visualiza el error "on die", por lo que entiendo conecta, pero si cambio el dato de usuario o clave tampoco veo ningun error.