when click on button, how renew info on page?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello everyone,

with this code, a table is loaded with info from the mysql db with id = '1'.

but now i want to make a button, and when it is clicked, he has to renew the table with the info from the db with id ='2'

does anyone know has this should be done?

thanks in advance!

Greetings,

Gert Vonck


<html> <head> <title> </title> </head> <body>

<?php
mysql_connect("localhost","root","") or
	die ("Could not connect to database");
mysql_select_db("oh") or
	die ("problems selecting database");

?>

<h2>Info_DJ</h2>

<?php

$result0 = mysql_query("SELECT naam,leeftijd,muziekgenre,favoriet_liedje,motto,picture_right FROM info_dj WHERE id='1'") or die (mysql_error());

	print"<table border=1>\n";
	$field_count = mysql_num_fields($result0);
	while ($get_info0 = mysql_fetch_row($result0))
	{
		print "<tr><td><table>";
		for($i = 0; $i < $field_count - 1 ; $i++){
			$value = $get_info0[$i];
			$column = mysql_field_name($result0,$i);
			print "\t<tr><td>$column</td><td>$value</td></tr>\n";
		}
		$last = $field_count - 1;
		print "</table></td><td><img src='$get_info0[$last]'></td></tr>\n";
	}

	print "</table>\n";
	mysql_close();

?>

</body>
</html>





_________________________________________________________________



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux