www.webdeveloper.com
Results 1 to 1 of 1

Thread: how to cross reference $_POST array 'checkboxes[]' with mysql field

  1. #1
    Join Date
    Jun 2005
    Posts
    25

    how to cross reference $_POST array 'checkboxes[]' with mysql field

    how to cross reference $_POST array 'checkboxes[]' with mysql field

    I have a form that is submitted so the user can select which results to print. but I am having problems getting the results to show correctly.

    how do I correctly cross reference the form data with the mysql
    Code:
    $getRequests = mysql_query("SELECT * FROM requests WHERE `customer_email`='{$_SESSION['FM_user']}'");
    	while($request = mysql_fetch_assoc($getRequests)) {
    		if (in_array($request['request_id'],array($_POST[request]))) {
    			echo '<li style="font-size:10px; border-bottom: 0.1em solid #D0D0D0"> 
    				<div class="leftfloat"> <input type="checkbox" name="request[]" value="',$request['request_id'],'"> </div>
    				<div class="leftfloat"> <em>',$request['request_id'],'</em> </div><div class="leftfloat"> | </div>
    				<div class="leftfloat"> <em>',$request['customer_name'],'</em> </div><div class="leftfloat"> | </div>
    				<br style="clear:both">
    				</li>';
    		}
    	}
    Last edited by jasonc310771; 04-05-2011 at 01:38 PM. Reason: i have taken away the ! in the IF statement, but the problems still exists

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles