Here's a sample of the code I'm having touble with. I get nothing but a
blank page and my gas tank(brain) is running on fumes so to speak. It works
fine without the if..else but with it I get nothing. I'm just trying to see
if the variable exists, if it does I update the record, if it doesn't I
create a new record and write the ID to $TransID.
Robert
//write session data to transactions database
if ( isset( $TransID ) )
$link5 = mysql_pconnect( "64.0.182.176", $user, $pass );
mysql_select_db( $db )
or die ( "Couldn't open $db: ".mysql_error() );
$query5 = mysql_query( "UPDATE transactions set CustomerID =
'$user_ID', SessionID = '$SID', Status = 'Incomplete' WHERE ID ='$TransID'")
or die ( "Couldn't open $db: ".mysql_error() );
//write lane to database
$link2 = mysql_pconnect( "64.0.182.176", $user, $pass );
mysql_select_db( $db )
or die ( "Couldn't open $db: ".mysql_error() );
$query2 = mysql_query( "INSERT INTO lanesdb ( ProjectID, LaneNo, Genus,
Species, LCompare, Primer, Notes, SampleID, TransID )
values( '$gelID', '$LaneNo', '$Genus', '$Species', '$LCompare',
'$Primer', '$Notes', '$SampleID', '$TransID' )")
or die ( "Couldn't open $db: ".mysql_error() );
mysql_close( $link, $link1, $link2, $link5 );
header("Location:modify_gels.php?id=$gelID");
else
$link3 = mysql_pconnect( "64.0.182.176", $user, $pass );
mysql_select_db( $db )
or die ( "Couldn't open $db: ".mysql_error() );
$query3 = mysql_query( "INSERT INTO transactions ( CustomerID,
SessionID, Status )
values( '$user_ID', '$SessionID', 'Incomplete' )")
or die ( "Couldn't open $db: ".mysql_error() );
session_register( "TransID" );
$TransID = mysql_insert_id( $query3 );
//write lane to database
$link2 = mysql_pconnect( "64.0.182.176", $user, $pass );
mysql_select_db( $db )
or die ( "Couldn't open $db: ".mysql_error() );
$query2 = mysql_query( "INSERT INTO lanesdb ( ProjectID, LaneNo, Genus,
Species, LCompare, Primer, Notes, SampleID, TransID )
values( '$gelID', '$LaneNo', '$Genus', '$Species', '$LCompare',
'$Primer', '$Notes', '$SampleID', '$TransID' )")
or die ( "Couldn't open $db: ".mysql_error() );
mysql_close( $link, $link1, $link2, $link3 );
header("Location:modify_gels.php?id=$gelID");
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]