Jump to content

Multi Table Insert not working...


jay7981

Recommended Posts

Hey all,

 

i have a multi table instert i am trying to do and its not inserting and is only displaying blank could i get a second set of eyes to check the code and tell me where i went wrong?

 

<?php
include './config.php'; //(holds the actual database info and some variables for tables (that im not actually using))
//include './access.php'; //(Holds some array variables that i use in other pages.)


$db3 = mysql_connect ($hostname, $username, $password) or die ('Failed to connect to database: ' . mysql_error());
mysql_select_db ($database);

	$authid = "'" . mysql_real_escape_string($_POST['authid']) . "'";
	$name = "'" . mysql_real_escape_string($_POST['name']) . "'"; 
	$email = "'" . mysql_real_escape_string($_POST['email']) . "'";
	$fid = "'" . mysql_real_escape_string($_POST['fid']) . "'";
	$rank = "'" . mysql_real_escape_string($_POST['rank']) . "'";
	$access = "'" . mysql_real_escape_string($_POST['access']) . "'";
	$admin_id = "'" . mysql_real_escape_string($_POST['admin_id']) . "'";
	$group_id = "'" . mysql_real_escape_string($_POST['group_id']) . "'";

$query = "INSERT INTO bioclan.clan_members a INNER JOIN bioclan.admins b ON a.authid = b.auth INNER JOIN bioclan.sm_admins c ON a.authid = c.identity INNER JOIN bioclan.sm_groups d ON d.id = e.group_id INNER JOIN bioclan.sm_admins_groups e ON c.id = e.admin_id (a.authid,a.name,a.email,a.fid,a.rank,b.auth,b.name,b.access,c.identity,c.name,e.admin_id,e.group_id) VALUES ($authid,$name,$email,$fid,$rank,$authid,$name,$access,$authid,$name,$admin_id,$group_id)";


if ($result = mysql_query($query)) 
{  
	 if (mysql_affected_rows() == 1) 
	{    
		echo "<font size=\"+1\" color=\"red\">Update OK!</font>"; 
		mysql_close($db3);
		include ('./includes/spry.php');
	} 
	else 
	{    
		echo "<font size=\"+1\" color=\"red\">Oops! Something went wrong</font>";
		mysql_close($db3);
		include ('./includes/spry.php');
	}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/192660-multi-table-insert-not-working/
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.