Ghussaizzain Biturre
New member
i have a script here :
<?php
include 'main.php'; //Include mysql connection
if ($_POST) { // If form posted
$Value_to_change = $_POST['Username'];
$query = "SELECT Street FROM Users WHERE ID=$ID";
$Result = mysql_query($query);
$Row = mysql_fetch_array($Result);
$Street = $Row['Street'];
echo $Street;
}
else
{
$query = "SELECT ID, Username FROM Users ORDER BY ID"; //Build MySQL query
$Result = mysql_query($query); // Query database
// Below is loop for table row's + query results
echo "<select size=\"1\" name=\"Username\">"; // Construct top of drop down list
while($Row = mysql_fetch_array($Result)){ // Loop all Usernames in database
$ID = $Row['ID'];
$Username = $Row['Username']; // Put Username into solid Vairible
echo"<option value=\"$ID\">$Username</option>"; // Display option
}
echo "</select>"; // Finish drop down list
}
?>
and where echo $Street is (Line 8) i whould like the script to auto refresh and show me the street,
any hewlp would be great
thanks
i already know how to put it in a form, this script is part of something else and it needs to auto refresh the page i can't put in a $_POST because its being used by the rest of the page for other things and the street is what its posting, i know java script can do it i just don't know the code
thanks again and my bad for not being clearer with what i needed
Also this is the deal with the script, this will go on a page and a form will be displayed, when the admin selects a user name, more form is to be displayed to edit, however the existing contents for the form needs to be there, so the admin can edit these "hidden fields" and submit the changes to effect the user
<?php
include 'main.php'; //Include mysql connection
if ($_POST) { // If form posted
$Value_to_change = $_POST['Username'];
$query = "SELECT Street FROM Users WHERE ID=$ID";
$Result = mysql_query($query);
$Row = mysql_fetch_array($Result);
$Street = $Row['Street'];
echo $Street;
}
else
{
$query = "SELECT ID, Username FROM Users ORDER BY ID"; //Build MySQL query
$Result = mysql_query($query); // Query database
// Below is loop for table row's + query results
echo "<select size=\"1\" name=\"Username\">"; // Construct top of drop down list
while($Row = mysql_fetch_array($Result)){ // Loop all Usernames in database
$ID = $Row['ID'];
$Username = $Row['Username']; // Put Username into solid Vairible
echo"<option value=\"$ID\">$Username</option>"; // Display option
}
echo "</select>"; // Finish drop down list
}
?>
and where echo $Street is (Line 8) i whould like the script to auto refresh and show me the street,
any hewlp would be great
thanks
i already know how to put it in a form, this script is part of something else and it needs to auto refresh the page i can't put in a $_POST because its being used by the rest of the page for other things and the street is what its posting, i know java script can do it i just don't know the code
thanks again and my bad for not being clearer with what i needed
Also this is the deal with the script, this will go on a page and a form will be displayed, when the admin selects a user name, more form is to be displayed to edit, however the existing contents for the form needs to be there, so the admin can edit these "hidden fields" and submit the changes to effect the user