CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 automatic insert a record,passing variable problem

Print topic Send  topic

Author Message
thomas
Posted: 10/02/2002, 11:32 PM

Hi,

i have a formular that should automatic insert a record into a mysql-database if it is opened.

i wrote into the open event of the the formular the following code:

$db->query("INSERT INTO kontakte VALUES ('','','','','','','','','','','','','','','','')");
$last = mysql_insert_id();

How is it possible to give the ID of the last insert record ($last), to the running record formular, so that the button update is shown ?

many thanx for help !!!
thomas
thomas
Posted: 10/03/2002, 1:33 AM

Hi,

i found a solution. Just put a empty menu form at previous position. In the open event you put the following code. the refreshed must have an input variable for $kontaktklid. thats all

$flddate1=date("Y-m-d");
$fldtime1=date("G:i");

$UserID = get_session("UserID");

$db->query("INSERT INTO kontakte VALUES ('','','$flddate1','$fldtime1','','','$UserID','','','','','','','','','')");
$last = mysql_insert_id();
header("Location: inbound_call_kl_0.php?kontaktklid=".$last);

   


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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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