Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Inserting Into Database Table Rate Topic   - - - - -

 
  • Marwa
  • Advanced Member
  • Members
  • Join Date: 02-Mar 22
  • 55 posts

Posted 25 May 2022 - 05:41 PM #1

hello i want to insert ( transaction ID )  and its 36 length string i added the following:

 

     $data = array
   (
         'payment_id' =>  $order_info['payment_id'],
         'trnsction_id' =>  $tranID ,
         'status' => $pp_response['order_status']
        
     );
 

db_query('INSERT INTO ?:xxx ?e', $data);

 

orderid and payment id were inserted successfully every time i test it but taransaction id keep inserted as 0 ????

any one can help !

 

 

 



 
  • thecigarhut
  • Advanced Member
  • Members
  • Join Date: 07-Dec 21
  • 72 posts

Posted 25 May 2022 - 08:57 PM #2

perhaps check your spelling?

database table cscart_order_transactions has it listed as 
 

transaction_id transaction_id

osCommerce user since 2005 now upgrading to CS-Cart Ultimate.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22892 posts

Posted 26 May 2022 - 05:47 AM #3

If type of the trnsction_id column is integer, but you try to insert string, it will be converted to 0


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • Marwa
  • Advanced Member
  • Members
  • Join Date: 02-Mar 22
  • 55 posts

Posted 26 May 2022 - 04:20 PM #4

If type of the trnsction_id column is integer, but you try to insert string, it will be converted to 0

i checked and it was set correctly! it holds string and i insert string but keeps appear 0


 

perhaps check your spelling?

database table cscart_order_transactions has it listed as 
 

transaction_id transaction_id

 

already checked! :( still inserting 0



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22892 posts

Posted 27 May 2022 - 08:06 AM #5

So what happens if you replace

 'trnsction_id' =>  $tranID ,

with

 'trnsction_id' =>  123,

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1673 posts

Posted 27 May 2022 - 08:46 AM #6

Hello

 

Please show structure table.

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl | marketplace | Multi-Vendor/CS-Cart Development | Dedicated developers

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • Marwa
  • Advanced Member
  • Members
  • Join Date: 02-Mar 22
  • 55 posts

Posted 27 May 2022 - 11:11 AM #7

Hello

 

Please show structure table.

 

Best regards

Robert

 

CREATE TABLE `xxxxx` (
  `ID` int(11) NOT NULL,
  `payment_id` int(11) NOT NULL,
  `transaction_id` varchar(36) NOT NULL,
  `status` varchar(400) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


 


 
  • Marwa
  • Advanced Member
  • Members
  • Join Date: 02-Mar 22
  • 55 posts

Posted 27 May 2022 - 11:22 AM #8

 

So what happens if you replace

 'trnsction_id' =>  $tranID ,

with

 'trnsction_id' =>  123,

i tried an it appears empty:

dot.gif Edit dot.gif Copy dot.gif Delete    24 29                         P  Edit dot.gifCopy dot.gifDelete   dot.gif25 29   P  

columns : ID , payment_id , transaction_id , status



 
  • Marwa
  • Advanced Member
  • Members
  • Join Date: 02-Mar 22
  • 55 posts

Posted 27 May 2022 - 11:26 AM #9

 

So what happens if you replace

 'trnsction_id' =>  $tranID ,

with

 'trnsction_id' =>  123,

trasaction id holds Universally Unique Identifier. This field should be sent with every request and is unique per request. Example “1e056384-625a-43ba-9876-6ddd7d9a5d51”



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1673 posts

Posted 27 May 2022 - 11:39 AM #10

Hello

 

Please show your code inset into this table (copy not rewrite)

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl | marketplace | Multi-Vendor/CS-Cart Development | Dedicated developers

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • Marwa
  • Advanced Member
  • Members
  • Join Date: 02-Mar 22
  • 55 posts

Posted 27 May 2022 - 11:49 AM #11

Hello

 

Please show your code inset into this table (copy not rewrite)

 

Best regards

Robert

trasaction id holds Universally Unique Identifier. This field should be sent with every request and is unique per request. Example “1e056384-625a-43ba-9876-6ddd7d9a5d51”

 

   $data = array
   (
         'payment_id' =>  $order_info['payment_id'],
         'trnsction_id' =>  $transID,
         'status' => $pp_response['order_status']
        
     );
 

db_query('INSERT INTO ?:'tablename' ?e', $data);
     


 



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1673 posts

Posted 27 May 2022 - 12:07 PM #12

Hello

 

trnsction_id ? field name is transaction_id

as you write earlier

 

CREATE TABLE `xxxxx` (

  `ID` int(11NOT NULL,
  `payment_id` int(11NOT NULL,
  `transaction_id` varchar(36NOT NULL,
  `status` varchar(400NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
 
Best regards
Robert

Team of SoftSolid
cs-cart.pl | marketplace | Multi-Vendor/CS-Cart Development | Dedicated developers

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • Marwa
  • Advanced Member
  • Members
  • Join Date: 02-Mar 22
  • 55 posts

Posted 27 May 2022 - 12:42 PM #13

 

Hello

 

trnsction_id ? field name is transaction_id

as you write earlier

 

CREATE TABLE `xxxxx` (

  `ID` int(11NOT NULL,
  `payment_id` int(11NOT NULL,
  `transaction_id` varchar(36NOT NULL,
  `status` varchar(400NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
 
Best regards
Robert

 

thank you so much i checked the spelling now it works :)



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1673 posts

Posted 27 May 2022 - 12:58 PM #14

Hello

 

You are welcome :)

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl | marketplace | Multi-Vendor/CS-Cart Development | Dedicated developers

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • thecigarhut
  • Advanced Member
  • Members
  • Join Date: 07-Dec 21
  • 72 posts

Posted 27 May 2022 - 06:39 PM #15

thank you so much i checked the spelling now it works :)

 

guess you did not read my reply above, 

 

perhaps check your spelling?

database table cscart_order_transactions has it listed as 
 

transaction_id 

 


osCommerce user since 2005 now upgrading to CS-Cart Ultimate.


 
  • Marwa
  • Advanced Member
  • Members
  • Join Date: 02-Mar 22
  • 55 posts

Posted 28 May 2022 - 07:39 AM #16

guess you did not read my reply above, 

i checked the spelling of the table name ,,, and i did not check the fields name spelling in my code i thought they were right :/

thank you :))))