Jump to content

[Resolvido] agenda


Recommended Posts

Boas pessoal

estou a fazer uma agenda electronic em php. estou com um problema:

tenho o seguinte pedaço  de codigo na pagina admin:

case "A":
					$sql = "select * From agenda";
					$result = mysql_query($sql,$con);
					$nRegistos = mysql_num_rows($result);
						echo " <table width=\"600\" border=\"0\" align=\"center\">";
							$registo = mysql_fetch_array($result);
							echo "<tr align=\"center\" valign=\"middle\">";
    								echo "<td> <a href =\"actualiza.php?id={$registo['ID']}\">{$registo['nome']}</a></td>";
							 	echo "</tr>";
							echo "</table>";	
					}else { echo"<p> Nao existem registos:".$nRegistos. "</p>";}

depois tenho no actualiza assim:


$sql = "select * from agenda where ID=".$user;
$res = mysql_query($sql,$con);
$registo = mysql_fetch_array($res);
$_SESSION['id'] = $registo['ID'];


no codigo sql queria q seleccionasse o registo que foi sescolhido na pagina admin, ou seja queria transportar o id para o actualiza dependendo do registo que escolhesse



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.