No announcement yet.

Beating head against wall

  • Filter
  • Time
  • Show
Clear All
new posts

  • Beating head against wall

    Ok I have tried functions in MySQL to solve an issue to no avail

    Does anyone know if and how to do this in php

    Here is scenario
    Select distinct columna, columnb, columnc
    From table
    Save the results to an array
    Loop through the array
    And update columnd where
    Column1=columna and
    Column2=columnb and

    Of course using the value if each array line

    Any help?
    Less and less hair



  • #2
    I think I'm missing something because this shouldn't be so difficult?

    With SC macro you can execute a select where the results will be in an array. Don't know if that's wise as if the resultset is large the query might fail due to memory issues. You can consider using a cursor instead (record for record extract). Then you do just the simple update. But there is a snag... You need to use your own variable name to assing the sql result to. If you use the standard generated code from the editor snippets you will see that it uses the same variable. Then things go wrong... So if you use the same variable for select and update ... well you get the picture. Easy to overlook.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development /