mjcoco Posted May 16, 2008 Share Posted May 16, 2008 Im passing about 5 variables though post. Its sloppy, but im just trying to get it to work before i go back and make it run smooth. Anyway here is some code im having problems with.. Not sure if i need to post more of the code, but here is where, i believe the problem lies... <form id = "myform" enctype="multipart/form-data" action="upload_file.php" method="POST"> <table width="527" height="110" border="0" align="left" cellpadding="0" cellspacing="0"> <tr><td width="172" height="32">University:</td> <td width="262"><select name="Univers" onChange="getDepart(this.value)"> <?php displayUniversity();?> </select></td> </tr> <tr><td width="172" height="32">Department:</td> <td width="262"><div id="departdiv"><select name="Department" id="Department"> <option>Select University First</option> </select></div> </td> </tr> My sql statement $de = $_POST['Department']; $q = "select * from department WHERE dept_id = $de"; $result = mysql_query($q,$conn); $a = mysql_fetch_array($result); Getting the Warning mysql_fetch_array(): supplied argument is not a valid MySQL result resource Which of course means that it is not getting a result in the fetch. I understand that. Here is my problem. I am passing 3 other variables which all execute perfect. This one on the otherhand is not. I cant figure out what the problem is or where it is at. The Univers _POST works great. However when i try it with the Department it does not run. Its partial code. I have it running with ajax (along with the other 2 variables that work fine) which populates the Department dropdown box. Any insight would be helpful. Quote Link to comment Share on other sites More sharing options...
mjcoco Posted May 16, 2008 Author Share Posted May 16, 2008 Sorry this post might need to be in PHP rather than in mysql. :-\ Quote Link to comment Share on other sites More sharing options...
mjcoco Posted May 16, 2008 Author Share Posted May 16, 2008 Ok, i figured it out. While i was calling the ajax function it was named wrong. Fixed it it worked perfect. Thought i checked it last night, oh well. 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.