$q="INSERT INTO proj select * from projtemp where projid ='".$projid."'";

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kkshansid
    New Member
    • Oct 2008
    • 232

    $q="INSERT INTO proj select * from projtemp where projid ='".$projid."'";

    Code:
    $projid=$_GET['projid'];
    $q="INSERT INTO proj select * from projtemp where projid ='".$projid."'";
     $qins=mysql_query($q);
    is resulting false
    is there any error?
    there are 2 tables in a database with name proj and projtemp
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Originally posted by kkshansid
    Code:
    $projid=$_GET['projid'];
    $q="INSERT INTO proj select * from projtemp where projid ='".$projid."'";
     $qins=mysql_query($q);
    is resulting false
    is there any error?
    there are 2 tables in a database with name proj and projtemp
    First, I would make sure that when running this through the web page you are running it from, that it the sql statement returns what you expect.

    Second, you could always try replacing the quote sequence you have, making this:

    Code:
    projid ='".$projid."'
    with:

    Code:
    projid =\".$projid.\"
    Sometimes its better to escape the double quotes to remove their meaning.

    Regards,

    Jeff

    Comment

    • kkshansid
      New Member
      • Oct 2008
      • 232

      #3
      Originally posted by numberwhun
      First, I would make sure that when running this through the web page you are running it from, that it the sql statement returns what you expect.

      Second, you could always try replacing the quote sequence you have, making this:

      Code:
      projid ='".$projid."'
      with:

      Code:
      projid =\".$projid.\"
      Sometimes its better to escape the double quotes to remove their meaning.

      Regards,

      Jeff
      it solved no of columns ware different in both tables

      Comment

      Working...