Loading ...
Sorry, an error occurred while loading the content.

Re: [bang-phpug] Why more than one update query is not running in php

Expand Messages
  • Ved Prakash
    Hi Bhavna, 1. Check error.log if there is any error message thats getting generated, after you run your application or 2. wherever you are executing query, you
    Message 1 of 5 , Jun 20, 2007
    • 0 Attachment
      Hi Bhavna,

      1. Check error.log if there is any error message thats getting generated,
      after you run your application
      or
      2. wherever you are executing query, you should do this

      $res = mysql_query($updatequery);
      if(!$res) {
      echo mysql_error();
      echo $php_errormsg;
      }

      mysql_query would return false if the query fails, and mysql_error would be
      set. $php_errormsg would return the last php error.

      Regards,

      Ved

      On 6/20/07, bhavna patel <bhavna_coolinus@...> wrote:
      >
      > Thanks for your suggetion but that's not a problem...
      > see the problem I have notised in every query like
      >
      > update daily_timerecord set DIFF=SUBTIME('00:20:00' ,SUBTIME('16:00:00',
      > '12:00:00')),IN_TIME= '12:00:00' ,OUT_TIME= '16:00:00' ,TOTAL_
      > TIME=SUBTIME('16:00:00' ,'12:00:00') where EMPLOYEE_ID= 2 and
      > UPDATE_DATE= '2007-06- 16'
      >
      > DIFF field is not getting change as i have noticed.
      > cant anybudy tell me why its not getting change through php and its
      > getting change through phpmyadmin
      >
      > where ever i am updating DIFF its not getting affected!!! I donn know why.
      > the rest of field is getting changed...
      >
      > i thought its reserved word of PHP or Mysql but its not as i have tried by
      > changing field name also
      >
      > Can anyone please help me out!!!
      >
      > bhavna.
      >
      >
      > ----- Original Message ----
      > From: Chidu <chidanandmba@... <chidanandmba%40gmail.com>>
      > To: bang-phpug@yahoogroups.com <bang-phpug%40yahoogroups.com>
      > Sent: Tuesday, June 19, 2007 1:17:57 PM
      > Subject: Re: [bang-phpug] Why more than one update query is not running in
      > php
      >
      > >
      > > _,_._,___
      > >
      > Hi Bhavna,
      >
      > It seems to be that, ur a have a very small problem in here, with the
      > query,
      > Even, I did face the same knida problem just a month ago, be sure that,
      > you
      > don't leave spaces in between any mysql functions, while typing up the
      > query, phpmyadmin removes any whitespaces in the query and you are able to
      > run them without any hasle.
      >
      > I suggest u, to just a look back on ur code...
      >
      > For Ex.:
      > Your query here:
      >
      > update daily_timerecord set DIFF=SUBTIME( '00:20:00' ,SUBTIME
      > ('16:00:00', '12:00:00' ),IN_TIME= '12:00:00' ,OUT_TIME= '16:00:00'
      > ,TOTAL_
      > TIME=SUBTIME( '16:00:00' ,'12:00:00' ) where EMPLOYEE_ID= 2 and
      > UPDATE_DATE= '2007-06- 16'
      >
      > and
      >
      > update daily_timerecord set TOTAL_TIME=SUBTIME( '00:00:00' ,TIMEDIFF
      > ('12:20:00', '12:00:00' )),DIFF=SUBTIME( DIFF,TIMEDIFF
      > ('12:20:00', '12:00:00' )) where EMPLOYEE_ID= 2 and UPDATE_DATE= '2007-
      > 06-16'
      >
      > A small and little correction: just remove the spaces in the functions:
      > here
      > have a look:
      >
      > update daily_timerecord set
      > DIFF=SUBTIME( '00:20:00' ,SUBTIME( '16:00:00' ,'12:00:00' )), IN_TIME='12:
      > 00:00',
      > OUT_TIME='16: 00:00', TOTAL_TIME=SUBTIME( '16:00:00' ,'12:00:00' ) where
      > EMPLOYEE_ID= 2 and UPDATE_DATE= '2007-06- 16'
      >
      > and second query here:
      >
      > update daily_timerecord set TOTAL_TIME=SUBTIME( '00:00:00' ,
      > TIMEDIFF('12: 20:00','12: 00:00')),
      > DIFF=SUBTIME( DIFF,TIMEDIFF( '12:20:00' ,'12:00:00' )) where EMPLOYEE_ID=
      > 2 and
      > UPDATE_DATE= '2007-06- 16'
      >
      > your only problems seems to be right here:
      > your code : TIMEDIFF ('12:20:00', '12:00:00' )
      > my suggestion : TIMEDIFF('12: 20:00','12: 00:00')
      >
      > That's seems to be very silly and basically shouldn't matter at all, since
      > I
      > faced the same problem, I just though of sharing with u. As, Iike ur
      > problem
      > is related to updation of the tables, for every update check for a value
      > to
      > be updated and then run the next query...
      >
      > --
      > Chidanand. G. B
      > +91-98456-51235
      >
      > [Non-text portions of this message have been removed]
      >
      > __________________________________________________________
      > Never miss an email again!
      > Yahoo! Toolbar alerts you the instant new Mail arrives.
      > http://tools.search.yahoo.com/toolbar/features/mail/
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.