473,763 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

232 New Member
Expand|Select|Wrap|Line Numbers
  1. $projid=$_GET['projid'];
  2. $q="INSERT INTO proj select * from projtemp where projid ='".$projid."'";
  3.  $qins=mysql_query($q);
is resulting false
is there any error?
there are 2 tables in a database with name proj and projtemp
Aug 10 '09 #1
2 2409
numberwhun
3,509 Recognized Expert Moderator Specialist
@kkshansid
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:

Expand|Select|Wrap|Line Numbers
  1. projid ='".$projid."'
  2.  
with:

Expand|Select|Wrap|Line Numbers
  1. projid =\".$projid.\"
  2.  
Sometimes its better to escape the double quotes to remove their meaning.

Regards,

Jeff
Aug 10 '09 #2
kkshansid
232 New Member
@numberwhun
it solved no of columns ware different in both tables
Aug 12 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
5648
by: newbie_mw | last post by:
Hi, I need urgent help with a novice problem. I would appreciate any advice, suggestions... Thanks a lot in advance! Here it is: I created a sign-up sheet (reg.html) where people fill in their first name, last name, email, etc. The data are then sent to a PHP script (reg.php). The data are then inserted into a table (reg) in MS SQL server. I have declared the variables like this: if (!(isset($_POST))) { $FirstName = "" ;
1
4539
by: newbie_mw | last post by:
Seems my post was buried in more cries for help :-) I will try again. It's probably a very novice question so please take a look! Thanks! ----------------------------------------------------------------- I created a sign-up sheet (reg.html) where people fill in their first name, last name, email, etc. The data are then sent to a PHP script (reg.php). The data are then inserted into a table (reg) in MS SQL server. I have declared the...
2
4711
by: EricRobineau | last post by:
hello I have a DB with many inter-related tables (MySQL) My main table called "content" has almost only foreign keys (integers) some have a 3 level relation (ex: content->city->region->country) I would like admins to be able to insert new records including all the "content" fields (in 1 page form) But how can I make an insert form that would display the related tables as list menus instead of a textfield with a number? (ex: select
5
3098
by: Chad Richardson | last post by:
Is there a way in SQL Server 2000 to extract data from a table, such that the result is a text file in the format of "Insert Into..." statements, i.e. if the table has 5 rows, the result would be 5 lines of : insert into Table (, , .... VALUES a,b,c) insert into Table (, , .... VALUES d, e, f) insert into Table (, , .... VALUES g, h, i) insert into Table (, , .... VALUES j, k, l) insert into Table (, , .... VALUES m, n, o)
4
6413
by: Fan Ruo Xin | last post by:
How to estimate the size of log space when I need to run "INSERT INTO tgt_tbl SELECT * FROM src_tbl WHERE..." ? What is the difference of before image between the above INSERT stmt and the following: begin transaction INSERT INTO tgt_tbl VALUES (...); ... INSERT INTO tgt_tbl VALUES (...); end transaction;
3
37813
by: Ed | last post by:
Hi, I want to load data to a table in Sql Server from a dataset table in my vb.net app using a dataAdapter. I know how to do this as follows (my question is to see if I can reduce the amount of code below): .... Dim DA As SqlDataAdapter = New SqlDataAdapter Dim Parm As New SqlParameter ....
6
1944
by: Rich | last post by:
Hello, I have to create a table in an Access mdb (remotely) on the fly. Create Table tbl1(fld1 Integer, fld2 varchar(10), fld3...) Then I have to insert data: Insert Into tbl1 Values(" & val1 & ", '" & val2 & "',...")"
20
18385
by: Mark Harrison | last post by:
So I have some data that I want to put into a table. If the row already exists (as defined by the primary key), I would like to update the row. Otherwise, I would like to insert the row. I've been doing something like delete from foo where name = 'xx'; insert into foo values('xx',1,2,...);
6
1209
by: Brock | last post by:
I'm doing a project from a QUE book by Gunderloy (70-305 MS test) for what it's worth it's on pp. 531.... There are directions to "Right- click the solution in Solution Explorer. Select Add, Add New Project. Add a new Visual Basic ASP.NET Web Application Library Project named RandomTimerTest" ... the problem is "Visual Basic ASP.NET Web Application Library Project" is not listed as a valid teplate in the wizard... any ideas? Thanks!!!...
0
10149
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9828
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8825
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7370
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5410
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3918
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3529
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2797
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.