My question is directed to the following: I need to bring the date that I have in the records and modify it and save the new date, but when I want to bring the date it says it is false, try with a statement in sql but it marks me error in the statement sqlsrv_fecth_array, I put the code I hope and you can help me.
<?php
$serverName = 'localhost';
$connectionInfo = array( "Database"=>"cccc", "UID"=>"gggg", "PWD"=>"vos");
/* Connect using Windows Authentication. */
try
{
$conn = sqlsrv_connect($serverName, $connectionInfo);
//echo 'Conectado';
}
catch(Exception $e)
{
die( print_r( $e->getMessage() ) );
}
$fecha = "";
$nombreQuejoso = "";
$apellidoQuejoso = "";
$servidorPublico = "";
$tipoAutoridad = "";
$nacionalidad= "";
$ocupacion="";
$domicilio="";
$localidad="";
$municipio="";
$telefono="";
$celular="";
$observaciones="";
$fechaNacimiento="";
$sql = "SELECT TOP 1 * FROM tExpedientes WHERE IdExpediente='" .$_GET['id']."' ORDER BY fecha DESC";
$version = sqlsrv_query($conn, $sql);
while ($row = sqlsrv_fetch_array($version)) {
$nombreQuejoso = $row["QuejosoNombre"]; //
$apellidoQuejoso = $row["QuejosoApellidos"]; //
$servidorPublico = $row["ServidorPublico"]; //
$tipoAutoridad = $row["TipoAutoridad"]; //
$sql1 = "SELECT date_Format(Fecha,'%d.%m.%Y HH:ii:ss') as NewFecha FROM tExpedientes WHERE IdExpedientes=Fecha ORDER BY Fecha DESC"; //
$fecha1 = sqlsrv_query($conn, $sql1);
**$row = sqlsrv_fetch_array($fecha1);**
$fecha = $row('NewFecha');
var_dump($fecha);
}
This is where I want to put it, maybe I'm wrong but I still do not know how to do it.
<legend>Cambio de Fecha</legend>
<input type="text" name="datepicker" id="datepicker" readonly="readonly" size="18" value="<?php echo ($fecha); ?>"><br>