Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.