•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 361,545 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,988 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 162 | Replies: 1 | Solved
![]() |
Hi All,
I think I'm lost.....
Here's my problem, I have a searchUser.php which allows the user to enter the Employee ID and submit (which searches for the user). The result is displayed from the chunk of code below. I want to allow the user to append a particular field, therefore i added the select to the table...whenever i click the update button, nothing happens....
here is the update.php code:
I think I'm lost.....
Here's my problem, I have a searchUser.php which allows the user to enter the Employee ID and submit (which searches for the user). The result is displayed from the chunk of code below. I want to allow the user to append a particular field, therefore i added the select to the table...whenever i click the update button, nothing happens....
{
echo"<tr><td>";
print("<center>
<table border='1' width='900'>
<tr align='center' bgcolor='#339900'>
<td><font face='verdana' size='2' color='white'><b>Employee ID</b></font></td>
<td colspan='2'><font face='verdana' size='2' color='white'><b>Name</b></font></td>
<td><font face='verdana' size='2' color='white'><b>Initials</b></font></td>
<td><font face='verdana' size='2' color='white'><b>Username</b></font></td>
<td><font face='verdana' size='2' color='white'><b>Access Level</b></font></td>
<td colspan='2'><font face='verdana' size='2' color='yellow'><b>Select Access to be Granted and Update</b></font></td>
</tr>");
for($counter=0; $myrow=mysql_fetch_row($result); $counter++)
{
print("<tr>");
foreach($myrow as $key => $value)
print("<td><font face='verdana' size='2'>$value</font></td>");
print("<form action='update.php' method='post'>");
print("<td><select name=accessType width='15'><option value=".$myrow[5].">Choose Access Level</option><option value=NULL>NULL</option><option value=User>User</option><option value=Admin>Admin</option><option value=SysAdmin>SysAdmin</option></select></td>");
}
print("<td><input name='btnUpdate' type='submit' value='Update' /></td>");
print("</tr></table></form></center>");
}here is the update.php code:
<?php
include("./connect.php");
global $conn;
$accessType = $_POST['accessType'];
$btnUpdate = $_POST['btnUpdate'];
if(isset($btnUpdate))
{
$empNo = $_GET[$myrow[0]];
$q1 = "UPDATE Operators SET accessLevel=".$accessType." WHERE EmployeeID =".$empNo;
$result1 = mysql_query($q1, $conn) or die("Update not successful");
}
?>
The man who in view of gain thinks of righteousness; who in the view of danger is prepared to give up his life; and who does not forget an old agreement however far back it extends - such a man may be reckoned a complete man.
~ Confucius, The Confucian Analects
~ Confucius, The Confucian Analects
I reposted this query, and it was solved there...
The man who in view of gain thinks of righteousness; who in the view of danger is prepared to give up his life; and who does not forget an old agreement however far back it extends - such a man may be reckoned a complete man.
~ Confucius, The Confucian Analects
~ Confucius, The Confucian Analects
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
Similar Threads
- File;usbechi.sys is needed? (Windows NT / 2000 / XP / 2003)
- Help needed for hijacker with homepage address location of C:\WINDOWS\secure.html (Viruses, Spyware and other Nasties)
- HijackThis help needed! (Viruses, Spyware and other Nasties)
- Hijack This log advice needed (Viruses, Spyware and other Nasties)
- landlord: What is MSIESH and is it needed (Viruses, Spyware and other Nasties)
- What is MSIESH and is it needed (Viruses, Spyware and other Nasties)
- Windows Update (Windows NT / 2000 / XP / 2003)
- Use Windows Update to Keep Your Computer Current (Windows tips 'n' tweaks)
- Help needed for IE6/Netscape problems (Web Browsers)
Other Threads in the PHP Forum
- Previous Thread: $_GET['id'] is not working?????
- Next Thread: Email code problem


Linear Mode