Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    17

    Thumbs up Unanswered: Using fields retrieved from SHOW FIELDS

    i have this php code which should use the fields retrieved using the SHOW FIELDS statement as fields for updating the table. I don't know if i had the logic rolling on inside this code:

    $result=mysql_query("insert into companydetail(companyid) values('$companyid')") or die("ayaw");
    $resultb = mysql_query("SHOW FIELDS FROM companydetail")or die("ayaw3");
    while ($row = mysql_fetch_array($resultb))
    {
    if ($row['Field']!=$companyid)
    {
    $resultc=mysql_query("update companydetail SET $row[Field]='$companyfields[$i]' where companyid='$companyid'") or die("ayaw2");
    $i=$i+1;
    }
    }

    i can't seem to get the fields from the SHOW FIELDS statement to work as another field to update the table. Hope you'll help me.
    Last edited by Deviruchi; 05-19-04 at 10:41.
    What? Can't move without me?

  2. #2
    Join Date
    Mar 2004
    Posts
    17

    Talking problem solved

    got it... thx anyway
    What? Can't move without me?

Posting Permissions

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