Jump to content

[SOLVED] Wierd problem with $_POST


mjcoco

Recommended Posts

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.