#1 (permalink)  
Old 07-14-05, 02:19 PM
DetroitGuy DetroitGuy is offline
Newbie Coder
 
Join Date: Jun 2005
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Forms

Alright. Having a problem here.

On one page, I am polling my database for an email address and adding it to a hidden form field:

PHP Code:

<form name=\"approve\" method=\"post\" action=\"next.php\">

<input name=\"email\" type=\"hidden\" value=\"
$qry[email]\">
<input name=\"id\" type=\"hidden\" value=\"
$qry[id]\">
<input type=\"submit\" name=\"Submit\" value=\"Submit\">
</form> 
On the next page, I am trying to process it.
PHP Code:

$query mysql_db_query($database"SELECT * FROM $table WHERE email = '".$_POST['email']."' & id = '".$_POST['id']."'");

$qry mysql_fetch_array($query); 
As you can see from the above, I am generating the form based on the contents of the database. The problem is that when I get to the second page, the only email address that is showing up is the first email address on the list.

For instance, as there were three forms generated:

email: john@doe.com - id: 1
email: jane@doe.com - id: 2
email: joe@doe.com - id: 1

I am only getting the first email address. Where the second email address should be, it's returning nothing. Where the third email address should be, I am getting the first email again.

Anyone know what's going wrong?

Thanks in advance.

NOTE: In the first code snippet, the first \ is missing although I have it in the code. Odd.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-14-05, 02:22 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
Probably not a solution, but in your query statement, & should be && or AND.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 07-14-05, 02:26 PM
DetroitGuy DetroitGuy is offline
Newbie Coder
 
Join Date: Jun 2005
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Oh my goodness. I swear that it is always those things that I miss. That was it exactly. Thanks Keith. I need to start looking more carfully before I post.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
order forms needs intercom Job Offers & Assistance 1 09-19-04 04:41 AM
Need a PHP Programmer to make forms. LiQuid2o Job Offers & Assistance 10 08-13-04 01:49 AM
Help replace form's title bar zigzag Windows .NET Programming 1 07-13-04 10:05 AM
HELP!! Multiple forms on one page??? tcooper PHP 5 07-03-04 09:59 PM
Auto-fill acrobat forms with MySQL's data ... kelvin188 General Advertisements 0 03-24-04 06:27 PM


All times are GMT -5. The time now is 03:01 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.