php update command problem discussion

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sauhard123
    New Member
    • Aug 2014
    • 1

    php update command problem discussion

    I want to update attendence column by inserting intime and outtime at the table below is the coding and I want to show the result on the browser and also should be updated in table

    $result = mysql_query("SH OW COLUMNS FROM mark_attendence ");
    while ($row = mysql_fetch_ass oc($result)) {
    mysql_query("UP DATE mark_attendence SET ".$row['InTime']." = '' WHERE ".$row['field']." = 'currentvalue'" )
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    why do you have that SHOW COLUMNS query there? if you want to update a field—and you know its name—why not using that name directly?

    besides that, there ain’t a key 'InTime' in the SHOW COLUMNS result. consult the MySQL manual to know what it really does.

    Comment

    • ngotung208
      New Member
      • Aug 2014
      • 1

      #3
      Thank you share posts. posts very useful!

      Comment

      Working...