php-windows | 2001042
Date: 04/30/01
- Next message: Dane Carlsson: "[PHP-WIN] Newbie question - Getting the path ?"
- Previous message: Toby Miller: "Re: [PHP-WIN] Help on MYSQL Table design"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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: php-windows-unsubscribe <email protected> For additional commands, e-mail: php-windows-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Dane Carlsson: "[PHP-WIN] Newbie question - Getting the path ?"
- Previous message: Toby Miller: "Re: [PHP-WIN] Help on MYSQL Table design"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

