Xtremer360 Posted November 26, 2010 Share Posted November 26, 2010 The first query goes through but the second does not just seeing if I'm missing something. <?php // Include the database page require ('../inc/dbconfig.php'); if (isset($_POST['submittitle'])) { $titlename = mysqli_real_escape_string($dbc, $_POST['titlename']); $titleshortname = mysqli_real_escape_string($dbc, $_POST['titleshortname']); $titlestyle = mysqli_real_escape_string($dbc, $_POST['titlestyle']); $titlestatus = mysqli_real_escape_string($dbc, $_POST['titlestatus']); $query = "INSERT INTO `titles` (titlename, titleshortname, style_id, status_id, creator_id, datecreated) VALUES ('$titlename','$titleshortname','$titlestyle','$titlestatus', 1, NOW())"; mysqli_query($dbc, $query); $query_id = mysqli_insert_id($dbc); $query1 = "INSERT INTO `champions` (title_id) VALUES ('$query_id')"; mysqli_query($dbc, $query1); } ?> Link to comment https://forums.phpfreaks.com/topic/219879-2-insert-queries/ Share on other sites More sharing options...
revraz Posted November 26, 2010 Share Posted November 26, 2010 echo $query1 Link to comment https://forums.phpfreaks.com/topic/219879-2-insert-queries/#findComment-1139838 Share on other sites More sharing options...
intellix Posted November 26, 2010 Share Posted November 26, 2010 I was going to say have you tried doing a: mysqli_query($dbc, $query1) or die (mysql_error()); or is it perhaps: mysqli_query($dbc, $query1) or die (mysqli_error()); ? Not used mysqli before but that's how you'd find out whats happening otherwise if there is an error related here Link to comment https://forums.phpfreaks.com/topic/219879-2-insert-queries/#findComment-1139847 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.