Jump to content

what the crap is wrong here?


mitchberry

Recommended Posts

i'm seriously frustrated right now.  I've been working on this project since last sunday, i've successfully related 4 different tables together to find all sorts of information, and ...

 

i get stuck HERE? 

 

ok here's the problem...

 

and its probably something so incredibly stupid...

 

	$user_password					= $_POST['user_password'];
$user_username					= $_POST['user_username']; 
$emp_id							= $_POST['emp_id'];	
$user_first						= $_POST['user_first'];
$user_last						= $_POST['user_last'];
$user_commission_rate			= $_POST['user_commission_rate'];
$user_leads						= $_POST['user_leads'];
$user_isadmin					= $_POST['user_isadmin'];

mysql_query("

UPDATE contractors 
SET 

emp_id							='".$emp_id."',
user_first						='".$user_first."',
user_last						='".$user_last."',
user_password					='".$user_password."',
user_leads						='".$user_leads."',
user_commission_rate			='".$user_commission_rate."',
user_isadmin					='".$user_isadmin.";
WHERE 
user_username = '".$user_username."' "); 

 

----

 

$user_commission_rate  and $user_isadmin are both formed from drop menus on a separate page...

 

the commission rate one works.... the user is admin one does not work. 

 

can anyone shed light into this ??????????????????

 

$user_isadmin = $row["user_isadmin"];
echo "<tr><td width=\"30px\"> </td>"; 
echo "<td width=\"100px\"><span class=\"smallfont\">Admin Status</span></td>";
echo "<td><span class=\"smallfont\">$user_isadmin</span></td>";
echo "<td><select name=\"user_isadmin\" id=\"user_isadmin\">
  <option value=\"$user_isadmin\">Select One...</option>
  <option value=\"1\">Allow</option>
  <option value=\"2\">Disallow</option>
  </select></td></tr>";

 

------------------

 

echo "<tr><td width=\"30px\"> </td>"; 
echo "<td width=\"100px\"><span class=\"smallfont\">Commission</span></td>";
echo "<td><span class=\"smallfont\">".$row["user_commission_rate"]."</span></td>";
echo "<td><select name=\"user_commission_rate\" id=\"user_commission_rate\">
  <option value=\"".$row["user_commission_rate"]."\">Select One...</option>
  <option value=\".1\">10</option>
  <option value=\".12\">12</option>
  <option value=\".15\">15</option>
  </select></td></tr>";

 

 

thanks in advance!!!!!!!!!!!!

Link to comment
https://forums.phpfreaks.com/topic/171112-what-the-crap-is-wrong-here/
Share on other sites

mysql_query("

UPDATE contractors 
SET 
emp_id ='".$emp_id."',
user_first ='".$user_first."',
user_last ='".$user_last."',
user_password ='".$user_password."',
user_leads ='".$user_leads."',
user_commission_rate ='".$user_commission_rate."',
user_isadmin ='".$user_isadmin.";
WHERE 
user_username = '".$user_username."' ");

 

after

'".$user_isadmin.";

 

you also have a semi colon which may throw an error (it will ignore the WHERE clause from the SQL statement. Try this:

 

mysql_query("

UPDATE contractors 
SET 
emp_id ='".$emp_id."',
user_first ='".$user_first."',
user_last ='".$user_last."',
user_password ='".$user_password."',
user_leads ='".$user_leads."',
user_commission_rate ='".$user_commission_rate."',
user_isadmin ='".$user_isadmin."'
WHERE 
user_username = '".$user_username."' ");

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.