Hi
Just a question.
can you use if statements in and update statement. What i am trying to do is update some records. It works fine just that one of the statements can reduce one of the values doiwn to 0. Now what i want to do is if it is going ot =0 then set it to 1 instead.
select if(Pos-1=0,UPDATE MenuHead set Pos=1 where MenHeadID='35',
UPDATE MenuHead set Pos=Pos-1 where MenHeadID='35')
That was somehting i was fidling with. Of course it doesnt work but just to give you a better idea with what i was messing about with.
Now i could easily do this with another stament with php etc but i am just trying to do somethign some new ways ie learn a better / quicker way of doing it.
UPDATE MenuHead set Pos=Pos-1 where MenHeadID='$mid'
is the one i curently use.
Thanks