Jump to content

insert not working


lamox

Recommended Posts

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']."' )";

Link to comment
https://forums.phpfreaks.com/topic/189009-insert-not-working/
Share on other sites

"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.

Link to comment
https://forums.phpfreaks.com/topic/189009-insert-not-working/#findComment-997917
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/189009-insert-not-working/#findComment-997919
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.