Fetch array, display and update, all in one.. ?

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Fetch array, display and update, all in one.. ?

    Hi All,

    I have designed a debit-system database with a PHP frontend. The amounts
    need to be updated on a monthly basis. now i have 10 clients in the system.
    i can get all the fields and display them, but next to that, i need to
    insert a field where we can enter an amount per client and after all the new
    amounts have been filled in, i need to update the database with those
    amounts entered.

    I know that by using html forms to enter the info, i can submit the info and
    do a update statement but the problem is, is that i need to dynamically add
    the field to update the amount according to the amount of results resturned
    from the database...

    Hope you guys understand what i mean here... !


    GM.


    Guest

  2. Similar Questions and Discussions

    1. if fetch array is empty ?
      Hi All - I'm doing a fetch_array and I would like to display a "no records found" message to screen. For some reason this is not working: ...
    2. Fetch Data From DB Into Array
      On Sun, 31 Aug 2003 22:33:50 +0100, "James" <graduate@dsl.pipex.com> wrote: You've now got at least five separate threads on this same issue...
    3. note 33928 added to function.odbc-fetch-array
      It seems as if this function doesn't work in PHP 4.3.2. The "Call to Undefined Function" error occurs when calling this function. ---- Manual Page...
    4. note 33659 added to function.mysql-fetch-array
      Testing for a null value is much easier than described above. Just test with if (is_null($row)) echo "IS NULL"; ---- Manual Page --...
    5. note 18947 deleted from function.mssql-fetch-array by didou
      Note Submitter: tommyx3ro@ihug.com.au ---- fetching an array of both numerically indexed and associative fields can complicate matters if you...
  3. #2

    Default Re: Fetch array, display and update, all in one.. ?

    In article <ch6r53$ed4$1@ctb-nnrp2.saix.net>, <post@gam.co.za> wrote:
    > Hi All,
    >
    > I have designed a debit-system database with a PHP frontend. The amounts
    > need to be updated on a monthly basis. now i have 10 clients in the system.
    > i can get all the fields and display them, but next to that, i need to
    > insert a field where we can enter an amount per client and after all the new
    > amounts have been filled in, i need to update the database with those
    > amounts entered.
    >
    > I know that by using html forms to enter the info, i can submit the info and
    > do a update statement but the problem is, is that i need to dynamically add
    > the field to update the amount according to the amount of results resturned
    > from the database...
    >
    > Hope you guys understand what i mean here... !
    If by "amount of results" you are refering to a row count, you could try:

    mysql_num_rows() ?

    If you mean a sum, you might be able to do something like:

    SELECT SUM(field) FROM tbl ...

    I'm not quite sure I understand the problem.

    Jamie

    --
    [url]http://www.geniegate.com[/url] Custom web programming
    User Management Solutions Perl / PHP / Java / UNIX

    Average_Joe Guest

  4. #3

    Default Fetch array, display and update, all in one.. ?

    Hi All,

    I have designed a debit-system database with a PHP frontend. The amounts
    need to be updated on a monthly basis. now i have 10 clients in the system.
    i can get all the fields and display them, but next to that, i need to
    insert a field where we can enter an amount per client and after all the new
    amounts have been filled in, i need to update the database with those
    amounts entered.

    I know that by using html forms to enter the info, i can submit the info and
    do a update statement but the problem is, is that i need to dynamically add
    the field to update the amount according to the amount of results resturned
    from the database...

    Hope you guys understand what i mean here... !

    GM.


    Guest

  5. #4

    Default Re: Fetch array, display and update, all in one.. ?

    Hi [email]post@gam.co.za[/email]

    If you want a response, better post to 1 group at a time.

    I responded in this group alone so I don't annoy all the others.
    I am curious if you find this answer.

    Tip: Post to comp.lang.php in the future. Very active. :-)

    To your question: No I do not understand what you mean.
    Actually I have a few ideas what you *could* mean, but that doesn't help.
    Sorry.

    Regards,
    Erwin Moller



    Erwin Moller Guest

  6. #5

    Default Re: Fetch array, display and update, all in one.. ?

    Hi Erwin,

    Thanx for the reply and my apologies for posting to multiple lists.

    Actually, all that needs to happen here :-

    i have a table with 300 entries of client account numbers and amounts. they
    need to be updated on a monthly basis. when i get the results from the
    database i need to add a field in php to update the existing amount. i.e.
    one field per row to add a new amount and update the database with the new
    amount.

    Hope this helps.


    Regards, Gawie.


    "Erwin Moller"
    <since_humans_read_this_I_am_spammed_too_much@spam yourself.com> wrote in
    message news:413dc88e$0$78738$e4fe514c@news.xs4all.nl...
    > Hi [email]post@gam.co.za[/email]
    >
    > If you want a response, better post to 1 group at a time.
    >
    > I responded in this group alone so I don't annoy all the others.
    > I am curious if you find this answer.
    >
    > Tip: Post to comp.lang.php in the future. Very active. :-)
    >
    > To your question: No I do not understand what you mean.
    > Actually I have a few ideas what you *could* mean, but that doesn't help.
    > Sorry.
    >
    > Regards,
    > Erwin Moller
    >
    >
    >

    Guest

  7. #6

    Default Re: Fetch array, display and update, all in one.. ?

    Hi [email]post@gam.co.za[/email]

    Sorry for very late response, I was in hospital for some time. :-(
    Better now. :-)

    Do you stillneed help or did you fix it yourself in the meantime?

    Regards,
    Erwin



    Erwin Moller Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139