lamox Posted January 19, 2010 Share Posted January 19, 2010 Hi all I have an insert transaction that just will not work. Am I not seeing anything? Any urgent help will be appreciated!! Rob <?php require_once('Connections/conYamaha.php'); ?> <?php //show all errors //error_reporting(E_ALL); //ini_set('display_errors', '1'); //end show all errors session_start(); // Load the common classes require_once('includes/common/KT_common.php'); // Load the tNG classes require_once('includes/tng/tNG.inc.php'); // Make a transaction dispatcher instance $tNGs = new tNG_dispatcher(""); // Make unified connection variable $conn_conYamaha = new KT_connection($conYamaha, $database_conYamaha); mysql_select_db($database_conYamaha, $conYamaha); $query = "INSERT INTO tblregproducts (memId, prodEPrefix, prodENo, prodPurchased, prodActive, prodYamaha, mmonth, yyear ) VALUE ('".$_SESSION['sub_id']."', '".$_SESSION['frPrefix']."', '".$_SESSION['frNo']."', '1', '1', '1', '".$_SESSION['mmonth']."', '".$_SESSION['yyear']."' )"; Quote Link to comment https://forums.phpfreaks.com/topic/189009-insert-not-working/ Share on other sites More sharing options...
cags Posted January 19, 2010 Share Posted January 19, 2010 "will not work" is in no way enough information for us to provide any meaningful help. We need to know if it's throwing an error, if there's no errors but it's not in the database (as checked by phpMyAdmin), if it's in the database but not being retrieved correctly. After running the query echo out mysql_error() and it will likely contain an error message. Quote Link to comment https://forums.phpfreaks.com/topic/189009-insert-not-working/#findComment-997917 Share on other sites More sharing options...
oni-kun Posted January 19, 2010 Share Posted January 19, 2010 Are you even running the query? mysql_select_db($database_conYamaha, $conYamaha); $query = "INSERT INTO tblregproducts (memId, prodEPrefix, prodENo, prodPurchased, prodActive, prodYamaha, mmonth, yyear ) VALUE ('".$_SESSION['sub_id']."', '".$_SESSION['frPrefix']."', '".$_SESSION['frNo']."', '1', '1', '1', '".$_SESSION['mmonth']."', '".$_SESSION['yyear']."' )"; $result = mysql_query("$query") or die(mysql_error()); $row = mysql_fetch_assoc($result); echo print_r($row); //Display result. Quote Link to comment https://forums.phpfreaks.com/topic/189009-insert-not-working/#findComment-997919 Share on other sites More sharing options...
lamox Posted January 19, 2010 Author Share Posted January 19, 2010 Sorry guys, reaLLY buggered up here. Was trying to add it to the completely wrong database! Quote Link to comment https://forums.phpfreaks.com/topic/189009-insert-not-working/#findComment-997938 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.