hi
I have an old website with a database which works ok online
now I want to test it on a lokal server
I have installed XAMPP and it is running fine
and moved a databasetabel to the local mysql
I Can not get asking the tabel from my website to work
I have:
<?php
# register_1.php;
header('Content-type: text/html; charset=utf-8'); /* HURRA DET VIRKER ! denne linie indsat allerførst :-) */
$connection=mysql_connect("localhost","nogndk_site","XXXXXXX");
if (!$connection) { echo "Could not connect to MySQL server!"; exit;}
$db=mysql_select_db("nogndk_site",$connection);
mysql_set_charset('utf8'); /* HURRA - og denne linie efter "select connection" :-) */
if (!$db) { echo "Could not change into the database"; exit;}
$pnr = $_POST['protokol']; $sota1 = $_POST['sort_1']; $sota2 = $_POST['sort_2']; $sota3 = $_POST['sort_3'];
echo "<center>Register for skifteprotokol nr $pnr </center>";
$sql="SELECT Folio_Nr, Skiftedato, Sognet, Efternavn, Fornavn
FROM hirtzholm
WHERE Protokol_Nr LIKE '$pnr'
ORDER BY $sota1, $sota2, $sota3";
$mysql_result=mysql_query($sql,$connection);
$num_rows=mysql_num_rows($mysql_result);
if ( $num_rows == 0 ) {
echo "Sorry there is no information";
} else {
echo "<TABLE ALIGN=\"CENTER\" BORDER=\"4\">";
echo "<TR><TH>Folio_Nr</TH><TH>Skiftedato</TH><TH>Sognet</TH><TH>Fornavn</TH><TH>Efternavn</TH></TR>";
while ($row=mysql_fetch_array($mysql_result))
{
$fol=$row["Folio_Nr"];
$dato=$row["Skiftedato"];
$sort_1=$row["Sognet"];
$sort_2=$row["Fornavn"];
$sort_3=$row["Efternavn"];
echo "<TR><TD> $fol </TD><TD> $dato </TD><TD> $sort_1 </TD><TD> $sort_2 </TD><TD> $sort_3 </TD></TR>";
}
}
mysql_close($connection);
?>
I know it is old - how do I get it to work on the local server
yours
erik
denmark