adn258's Profile User Rating: -----

Reputation: 11 Tradesman
Group:
Active Members
Active Posts:
764 (0.69 per day)
Joined:
31-August 11
Profile Views:
7,281
Last Active:
User is offline Yesterday, 11:01 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   adn258 has not set their status

Posts I've Made

  1. In Topic: What's The Best Way To Solve A Multi-Variable Update Problem?

    Posted 15 Jul 2014

    View Postandrewsw, on 14 July 2014 - 10:27 AM, said:

    I only want to suggest that doing this with client-side Javascript is not a great idea. It is unreliable and messy. Best to do this on the server-side, after the changes have been successfully committed to the database. You will have the opportunity to read the data that is currently in the database, not relying on what might show in the (client-side) form.

    On the server-side you might investigate UPDATE TRIGGERs, together with log-tables - to write the username, date/time, field-name, old-value, new-value. (UPDATE triggers may or may not be helpful in this process.)




    If you are trying to note every change to the database then this will quickly escalate into a v.large task. It is best to concentrate on a handful of significant fields if possible.


    Complicated yes I fully agree with you friend lol. I'm actually someone that can be good at thinking of complicated algorithms like this because I fear in this case friend Triggers won't work. I believe triggers only work for things IN the MYSQL database. I suppose you could update columns somehow called has_change_xyz as you suggested but this seems sloppy as usually triggers are intended for other things like summing up data etc. and not for something like this to my knowledge. I have a decent idea in my head and I'd be more than willing to show a solution for email updates via changes like this and maybe you can think of improvements?

    In this case the project I'm being required to work will REQUIRE that this be a feature somewhere along the line.
  2. In Topic: What's The Best Way To Solve A Multi-Variable Update Problem?

    Posted 14 Jul 2014

    Jon thanks I'm not asking about how to update the user input etc. I already have a form that does this and it works just fine, rather when the user uses the controls to update everything the drop downs for True False etc. change made to EXISTING vales in the table that users can edit need to be recorded.

    When these changes are recorded they need to be emailed to a list of emails (admins) about the updates/edits that occurred.

    I also know how to email the admins too what I'm asking about the best way to acquire the long string of changes/edits that a user could potentially change and change one a few or all variables for a given item.

    So for example: I have a MYSQL table that contains the following columns for houses:

    has_ac, has_tub, has_atrium, has_pool, has_closet, additional_comments

    For simplicity lets say the has values are boolean and additional comments is just a TEXT column. A user can than change EXISTING values so BOB logs in and there's a Form (again I'm not asking about how to update the values via a form) I know how to do this.

    In any case Bob logs in and he wants to change some values on a house (he's doing an edit)

    He goes to the Edit listing page and changes some values around he changes has pool from true to false and has_has_tube from false to true. He also adds some comments. He clicks the update button. Now I know how to update this via mysql but what I'm asking is at that point I would like to have an email dispatched to admins that says something along the lines of;

    "Attention Admins Bob updated XYZ house values: Has Tub To True, Has Pool To False, And additional_comments were added".

    So essentially some way to keep track of every change in one giant string that needs to be sent to admins. One of the ways I was thinking you could do this as stated above is using Javascript in the form and string concatenation. So when the user changes has_pool from true to false a string is being concatenated in a hidden field "" to += "User Changed Has Pool To False" += "User Changed has_tub To True". etc. etc.

    The problem with this idea though is if while Bob is on the same edit page and before he submits that page what if he changes back has_tub to false? You would need to add that to the algorithm so it's removed from the concatenated string since no changes were made. This gets VERY COMPLEX.

    Another way to do it is comparing values already in the MYSQL table to values submitted AFTER the form is submitted and creating a string that way. I'm trying to figure out an efficient way of doing this though. Do you have any ideas?


    Thanks Friend I hope this helped explain what I want.
  3. In Topic: Should You Session Protect Class Pages Only?

    Posted 10 Jul 2014

    thanks ctbweb and artificial soldier. You've answered my question. I know. Session poisoning can pose a real threat but that shouldn't be a problem with my configuration. Also you're right php scripts aren't pages but server code lol I see your point(s). Thank you guys for the help!
  4. In Topic: None of My Pages Let Me Include Other Javascript Files?

    Posted 21 Apr 2014

    View Postastonecipher, on 21 April 2014 - 06:47 PM, said:

    Your code is not in <script> tags, so it wouldn't work.


    Ok my code is in script tags friend I was just using this up here as a demo to show you generally why this is confusing. Also to the other guy saying you shouldn't use onload most of the time again I know that but that's not my point my point is I don't understand why this wouldn't be working.
  5. In Topic: I Can't Even Get Simple Android Applications To Work?

    Posted 30 Mar 2014

    I figured this out there was some internal error that I fixed by re-installing eclipse (who knows what was wrong but things are working fine now)

My Information

Member Title:
D.I.C Addict
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

adn258 hasn't added any friends yet.

Comments

adn258 has no profile comments yet. Why not say hello?