CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Insert same record in two columns of database

Print topic Send  topic

Author Message
RAN
Posted: 01/07/2003, 5:05 PM

I have to insert same record in two columns of the access database. I use CodeCharge.

When i insert the record "Phone" i would like to add same value in table "Phones" - Column "Phone_a" and "Phone_b" to MSAccess database.

I think to have a similar code in PHP but i need to convert for Asp

if ($sAction=="insert") {
$last_id = mysql_insert_id();
$sSQL2 = "insert into addresses (" .
"member_id," .
"phone," .
"email," .
"address)" .
" values (" .
tosql($last_id, "Number") . "," .
tosql($fldphone, "Text") . "," .
tosql($fldemail, "Text") . "," .
tosql($fldaddress, "Text") .
")";
$db->query($sSQL2);

}

Can anyone could help me please.
I past 1 week seach how to make this.
Thank you!
feha
Posted: 01/08/2003, 2:45 PM

Do You mean in two different tabels or rows on the same table?!







feha
[www.vision.to]
feha
Posted: 01/08/2003, 2:48 PM

meant columns instead of rows ...
Ran
Posted: 01/08/2003, 4:17 PM

In two diferents rows
Ran
Posted: 01/08/2003, 4:18 PM

The same value in two different rows on the same table
Thank you
Nicole
Posted: 01/10/2003, 5:45 AM

Ran,
In order to insert two identical rows into the same table run $sSQL2 query twice:
$db->query($sSQL2);
$db->query($sSQL2);

In case you need to insert the value of given field only into another record you should execute update query.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.