Results 1 to 2 of 2

Thread: reply to aus

  1. #1
    Join Date
    Feb 2004
    Posts
    2

    Unanswered: To rectify MySQL Error

    Hi,

    You had asked me to show the SQL I have used in php. The problem is located in this query.....


    update tc_rel_pass_sort set
    TestEngineer=\"$name\",Status='".$tcstatus[$i]."',TestedOn='".$tctestedon[$i]."',tcupdate='".$tcupdate[$i]."',NaviscoreStatus='".$naviscorestatus[$i]."',NiEMSStatus='".$niemsstatus[$i]."'
    ,ResultComments='".$comment[$i]."' where id='.$tcid[$i]."' and passid=".$passid[$i]);


    Here in this query you can see the following code segment

    ,ResultComments='".$comment[$i]."'


    Result Comments means the comments given by the test manager. I am supposed to read all the comment given by the test manager and put it in HTML. But the problem pops when there is " ' " sign in comments. So I just want MySQL to read all the comments given by test manager and I shoud not make any change in that comments like deleting the special character or adding some special character......

    I think you will be clear with my explanation... Can u help me out. I have to do it today itselt.....


    Thanks and regards,
    Vijesh
    Last edited by vijesh; 02-26-04 at 06:35.

  2. #2
    Join Date
    Oct 2003
    Location
    Denver, Colorado
    Posts
    137

    Re: To rectify MySQL Error

    Your string concatenation is not consistent. I don't know PHP, but it doesn't look like you are building the update query right. This code is weird:
    Code:
    "' where id='.$tcid[$i]."' and passid=".$passid[$i]
    Shouldn't it be
    Code:
    "' where id='".$tcid[$i]."' and passid=".$passid[$i]
    ?

Posting Permissions

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