User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Feb 2008
Location: Trinidad
Posts: 214
Reputation: maydhyam is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
maydhyam's Avatar
maydhyam maydhyam is offline Offline
Posting Whiz in Training

help needed for my update.....

  #1  
May 8th, 2008
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....

   
{
	   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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2008
Location: Trinidad
Posts: 214
Reputation: maydhyam is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
maydhyam's Avatar
maydhyam maydhyam is offline Offline
Posting Whiz in Training

Re: help needed for my update.....

  #2  
May 16th, 2008
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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 1:36 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC