Rory84 Posted December 2, 2010 Share Posted December 2, 2010 MySQL 5.0 http://www.sasdonline.com/cad/deputy/login.php?do=guest Above is the link to view the system to get an idea of what it does. It is a dispatch program. Members get access to buttons that create calls, close calls, go on duty/off duty, etc. The following command is a "Self Assign" key. My problem is, at this point in time, when a member clicks on "Self Assign", it brings up the form to enter the call number you wish to be assigned to, and when you put in the call number, you click submit, and it just does nothing. It goes back to entering a call number, not assigning you or anything. So, I scrapped the code and tried again. I'm rather new to PHP/MySQL so I know I'm missing something simple. What is the syntax I'm looking for, to check the callid given by the form, to proceed to the command that assigns the member to the correct call? Here is the code: if($_GET['do'] == "selfassign") { $q = mysql_query("SELECT * FROM users WHERE name = '".$myid."'") or die(mysql_error()); $row = mysql_fetch_assoc($q); if($row['status'] == "10-7") { echo "<br /><br />You cannot assign to a call, you are 10-7! <b><a href='index.php'>Return to Call View</a></b>"; die(); } if($row['busy'] == "1") { echo "<br /><br />You are already assigned to another call!! <b><a href='index.php'>Return to Call View</a></b>"; die(); } else { mysql_query("UPDATE responders SET response = 'EN' WHERE userid = '".$myid."' AND id = '".&callid."'") mysql_query("UPDATE users SET busy = '1' WHERE userid = '".$myid."'") echo '<script type="text/javascript">window.location = "index.php?save=98"</script>'; } <form action="index.php?do=selfassign&submit=true" method="POST" name="form"> Call Number (CALL#):<br /><input type="text" name="callid" maxlength="3"><br /> <br /><br /> <button type="submit" value="Submit">Next</button> } This code is copyrighted and commercial, and is not to be redistributed or any of the other material relating to this code is to be used without authorization by Andrew Harrison. Quote Link to comment Share on other sites More sharing options...
Rory84 Posted December 2, 2010 Author Share Posted December 2, 2010 Post can be removed. Problem solved. I can't edit the post, please remove the code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.