DiigIT | IT Community
No Profile Image
Welcome Guest
New User? Register | Login

Help with user array variable in query

By: rekha singh | 10 Mar 2010 4:02 pm

Hello all

I am using a class for Pay Pal IPN and need a little help accessing a variable sent to me by paypal in an array. 
The variable I am try to use is $p->ipn_data[ invoice] I need to the vaule of the varible in a query but I think my syntax is not correct on line 10  
Your help would be greatly appreciated

1     if ($p->validate_ ipn()) 
2    {
3  $hostname_store = "localhost";
4  $database_store = "home_store_ product";
5  $username_store = "home_store_ user";
6  $password_store = "password";
7  $store = mysql_pconnect( $hostname_ store, $username_store, $password_store) or trigger_error( mysql_error( ),E_USER_ ERROR); 
8    
9  mysql_select_ db($database_ store, $store);
10  $query_getinvoice num2 = "SELECT * FROM invoice WHERE invoice = '".$p->ipn_data[ invoice]. "'";
11  
12             $getinvoicenum2 = mysql_query( $query_getinvoic enum2, $store) or die(mysql_error( ));
13  $row_getinvoicenu m2 = mysql_fetch_ assoc($getinvoic enum2);
14  $totalRows_ getinvoicenum2 = mysql_num_rows( $getinvoicenum2) ;
15  
16  mysql_select_ db($database_ store, $store);
17  $query_Recordset1 = "SELECT * FROM `user` $row_getinvoicenum2 [query]";
18  $Recordset1 = mysql_query( $query_limit_ Recordset1, $store) or die(mysql_error( ));
19  $row_Recordset1 = mysql_fetch_ assoc($Recordset 1);
20  mysql_free_ result($getinvoi cenum2);
21  mysql_free_ result($Recordse t1);
22   }
DROP TABLE IF EXISTS `invoice`;
CREATE TABLE IF NOT EXISTS `invoice` (
  `invoice` int(9) NOT NULL auto_increment,
  `query` text NOT NULL,
  `subj` varchar(50) default '',
  `message` text NOT NULL,
  `image` varchar(50) default NULL,
  `business_name` varchar(50),
  `consultant` varchar(30) NOT NULL default '10.00',
  `executive` varchar(30) NOT NULL default '5.00',
  `sr_executive` varchar(30) NOT NULL default '10.00',
  `date_created` date NOT NULL,
  `message_status` enum('Not Sent','Sent' ) NOT NULL default 'Not Sent',
  PRIMARY KEY  (`invoice`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT= 123 ;

Comments

No Comments Posted for this Article.

Leave a comment

Enter the text in the image
img
Can't read?
Type the characters you see in the picture below.


Close Move