Kako mogu da iz baze mysql prikazem vrednosti polja u poljima forme, primer:
primer.php
<html>
<head><title>Baze podataka</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body {
background-color: #FFFF99;
}
.style1 {color: #FF0000}
-->
</style></head>
<body>
<form method="POST" action="primer2.php">
<span class="style1">BR</span>:
<input type="text" name="br" value=""/><br /><br />
<input name="submit" type="submit" class="style1" value="Nadji"/>
</form>
</body>
</html>
primer2.php
<?php
$connection=mysql_connect("localhost","root","");
if(!$connection){
die("GRESKA :".mysql_error());
}
$db_select=mysql_select_db("niivt",$connection);
if(!$db_select){
die("BAZA NIJE SELEKTOVANA:".mysql_error());
}
?>
<html>
<head><title>Baze podataka</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body {
background-color: #FFFF99;
}
-->
</style></head>
<body>
<?php
$brindeksa = $_POST['brindeksa'];
$query = "SELECT * FROM tabela".
" WHERE sid = \"$br\" ";
$result=mysql_query($query,$connection);
?>
</body>
</html>
<?php
mysql_close($connection);
?>
|