473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

I want to select data from one table and want to insert it into another table with ne

I want to select data from one table and want to insert it into another table with new values.Please help me .
$query = 'INSERT INTO opportunities VALUES(id, fname, lname, email, contact, vertical, location, global ,(SELECT fname,

lname, email, contact) FROM register WHERE id = $id';
$sql = mysql_query($query);
Please check this query and if it is wrong then send the correct query.
May 17 '18 #1
0 1253

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

Similar topics

1
by: Cliff | last post by:
I'm trying to do multiple insert statements. The table looks like this: CREATE TABLE $table (CNTY_CNTRY_CD char(3),ST char(2), CNTY_CNTRY_DESCR varchar(50),CNTY_CNTRY_IND char(1),...
5
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...
3
by: rdraider | last post by:
I'm doing a data conversion project, moving data from one SQL app to another. I'm using INSERT INTO with Select and have the syntax correct. But when executing the script I get: Server: Msg...
0
by: Alexander Vlasenko | last post by:
Please CC me, I am not subscribed. An imaginary SQL statement INSERT INTO table FETCH ... FROM cursor; looks almost the same as currently available INSERT INTO table SELECT ...; I tried it...
6
by: Dennis Gearon | last post by:
please CC me, I am on digest --------------------------------- I have the following code from an application that is 'mysql_centric'. I want to make it generic across all databases, if it's...
1
by: nel | last post by:
actually i want to insert for example : "insert in $table_name1 f$ield_name1, $field_name2, $field_name3 values $data1, $data2, $data3"; table & field variable i get from select statement form...
2
by: M Bourgon | last post by:
I have a file I'm trying to do some non-set-based processing with. In order to make sure I keep the order of the results, I want to BULK INSERT into a temp table with an identity column. The spec...
7
by: underground | last post by:
I wonder if possible on page load to query the value of a specific colmn and insert the result into another table. My query looks like so <? include("include/session.php"); ?> <? $usr =...
1
by: vinic | last post by:
This seems like it would be a straightforward function, but after searching all morning I'm a bit stuck. Into an exsiting db, I'd like to update a field (called "week") in rows with certain dates...
2
by: jazee007 | last post by:
Hi friend, I have a table named Hire Purchase details and another one named ScheduleT. In the table Hire Purchase Details I have a field named "HDCapital" and in the "ScheduleT" I have field...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.