Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6720711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:14:40+00:00 2026-05-26T09:14:40+00:00

I have a problem. I have a website with people and different transactions they

  • 0

I have a problem. I have a website with people and different transactions they make to and from a fake online bank. I want to be able to store an array of each person’s transactions on my mysql database. I want each transaction to be defined as an associative array with a timestamp and the sql query that represents their transaction with the “bank”.

Then I want those, after being serialized, to be the values of a transactions array that holds all of their transactions. Then I want to serialize that and store it in the database so that later I can add a transaction by unserializing it and appending a serialized array of another transaction to it. So far this code below works except that it just overwrites the one transaction and doesn’t append a new one. I’d really appreciate any help.

Thanks in advance

function modify_transactions($row, $sql)
{
 $sql=mysql_real_escape_string($sql);
 if(isset($row["TRANSACTIONS"]))
 {
  $transactions = unserialize($row["TRANSACTIONS"]);
 }
 else
 {
  $transactions = array();
 }
 $transaction_array = array("timestamp"=>time(),"query"=>$sql);
 $transaction_data  = serialize($transaction_array);
 $transactions[] = $transaction_data;
 $transactions_upload = serialize($transactions);
 $name = $row["NAME"];
 $query = "UPDATE band.students SET TRANSACTIONS = '$transactions_upload' WHERE students.NAME = '$name'";
 mysql_query($query);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:14:40+00:00Added an answer on May 26, 2026 at 9:14 am

    If I were you, I’d rather go for a new table where every entry would represent a transaction and that had a foreign key student_id.

    That’d be much, much, much cleaner and more flexible and scalable (i.e. what if you want to show the last 3 transactions of user X? What if a user had several million transactions?).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem I have some pages that need dynamic data from website to generate output
We have a problem under Microsoft IIS. People are not able to request the
I want people to be able to remove my app from their facebook-account from
I have a little problem with my website. People use this page to create
I have a website where people can sell products. Each time they add a
I have a problem with my CSS on a website I'm working on .
I have some problem with my cfml website. I have used the below code
I have a problem with maintenance of my php based website. My website is
I have a problem when using jsonp to API HTTPS website. it will return
I have a problem consistently displaying Facebook Comments on my AJAX driven website. Each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.