If the information in the form is the same as in the db then

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
oskare100
Forum Commoner
Posts: 80
Joined: Sun Oct 29, 2006 5:47 am

If the information in the form is the same as in the db then

Post by oskare100 »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hello,
The users should be able to write in their transaction IDs and email addresses in a form. If there is a row that contains the transaction ID (txn_id) AND email address (payer_email) that the user wrote into the form then the script should view the account password and login located in the same row as the transaction ID and the email address.

Here is my database structure:
[syntax="sql"]CREATE TABLE `temp_users` (
  `invoice` int(10) unsigned NOT NULL auto_increment,
  `receiver_email` varchar(60) default NULL,
  `item_name` varchar(100) default NULL,
  `item_number` varchar(10) default NULL,
  `quantity` varchar(6) default NULL,
  `payment_status` varchar(10) default NULL,
  `pending_reason` varchar(10) default NULL,
  `payment_date` varchar(20) default NULL,
  `mc_gross` varchar(20) default NULL,
  `mc_fee` varchar(20) default NULL,
  `tax` varchar(20) default NULL,
  `mc_currency` char(3) default NULL,
  `txn_id` varchar(20) default NULL,
  `txn_id_refund` varchar(17) default NULL,
  `txn_type` varchar(10) default NULL,
  `first_name` varchar(30) default NULL,
  `last_name` varchar(40) default NULL,
  `address_street` varchar(50) default NULL,
  `address_city` varchar(30) default NULL,
  `address_state` varchar(30) default NULL,
  `address_zip` varchar(20) default NULL,
  `address_country` varchar(30) default NULL,
  `address_status` varchar(10) default NULL,
  `payer_email` varchar(60) default NULL,
  `payer_status` varchar(10) default NULL,
  `payment_type` varchar(10) default NULL,
  `notify_version` varchar(10) default NULL,
  `verify_sign` varchar(10) default NULL,
  `referrer_id` varchar(10) default NULL,
  `memo` varchar(255) default NULL,
  `for_auction` varchar(20) default NULL,
  `auction_buyer_id` varchar(64) default NULL,
  `auction_closing_date` varchar(20) default NULL,
  `auction_multi_item` varchar(20) default NULL,
  `account_username` varchar(100) default NULL,
  `account_password` varchar(20) default NULL,
  `account_email` varchar(100) default NULL,
  `account_group` varchar(20) default NULL,
  `date` varchar(20) default NULL,
  PRIMARY KEY  (`invoice`),
  KEY `txn_id` (`txn_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=726857 ;
In other words, If I write in oskare200@oskar.com as email and 15468454f as transaction ID in the form and there is a row with the payer_email oskare200@oskar.com and the txn_id 15468454f it should view the account_username and the account_password in that row.

Here is what I've started with in the PHP script but I can't figure out how the rest..[/syntax]

Code: Select all

<?php
//Get information from the form
$txn_id = $_POST['txn_id'];
$item_number = $_POST['item_number'];
$payer_email = $_POST['payer_email'];

//Connect to MySQL
mysql_connect("localhost", "test", "test") or die(mysql_error());

//Select file system database
mysql_select_db("test") or die(mysql_error());

?>
Thanks,
Oskar R


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Have you played around making SELECT queries?
Post Reply