var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: populaing a listbox
Hi all, I've just started learning PHP so apologies if what I'm about to post is full on ridiculous but I'm definately stuck...
basically I'm trying to populate a listbox from a database in php myadmin, and I can do it fine jus using PHP but I'm wanting to run it through HTML as well, i dont know if i need to use _POST or _GET to make this work, or if there's some other method but any help will be appreciated, here's my code...
$con = mysql_connect("host", "database", "password");
die('Could not connect: ' . mysql_error());
$result = mysql_query("SELECT * FROM students");
echo "<table border='0'>";
echo "<td rowspan=\"6\">";
echo "<select size=10 name=userList mutiple>";
while($row = mysql_fetch_array($result))
echo "<option>$row[sname], $row[fname]</option>";
note: the host dbname password etc are all changed, it not being 'localhost' is definately not my issue =P
<form action="manageuser.php" method="post">
<select size=10 name=userList mutiple>
thanks in advance
Either POST or GET will work, the difference is in how you handle the data when you receive it at server (the action process).
POST is more secure.
POST is the equivalent of standard input
GET is the equivalent of a command line variable.
If you run this through a web server you should also look at the session_id() function.