MySQL Forums
Forum List  »  Spanish

Buenas, me podriais ayudar a pasar este trozo de sql a mysql. Esque estoy tratando de conectar una pagina php con una base de datos y poder visualizarla.
Posted by: Armando Paredes
Date: November 14, 2020 11:43AM

<?php
$serverName = "localhost";
$connectionOptions = array(
"Database" => "hola",
"Uid" => "root",
"PWD" => ""
);
$conn = sqlsrv_connect($serverName, $connectionOptions);
$tsql= "SELECT * FROM [dbo].[ilustrados]";
$getResults= sqlsrv_query($conn, $tsql);
if ($getResults == FALSE)
{
echo (sqlsrv_errors());
}
while ($row = sqlsrv_fetch_array($getResults, SQLSRV_FETCH_ASSOC))
{
echo ("<tr>");
echo("<td>".$row['Hola']."</td>". PHP_EOL);
echo("<td>".$row['Adios']."</td>". PHP_EOL);
echo("<td>".$row['Edad']."</td>". PHP_EOL);
echo("<td>".$row['AƱos']."</td>". PHP_EOL);
echo("<td>".$row['pro']."</td>". PHP_EOL);
echo("<td width='50'> <img src='".$row['foto']."' ></td>". PHP_EOL);

echo ("</tr>");
}
sqlsrv_free_stmt($getResults);


?>

Options: ReplyQuote


Subject
Views
Written By
Posted
Buenas, me podriais ayudar a pasar este trozo de sql a mysql. Esque estoy tratando de conectar una pagina php con una base de datos y poder visualizarla.
568
November 14, 2020 11:43AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.