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
https://forums.phpfreaks.com/topic/105886-solved-wierd-problem-with-_post/
Share on other sites

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.