FraanXT Posted May 26, 2014 Share Posted May 26, 2014 I can't find the error, someone help me please. $conn = mysql_connect("localhost","root","Pass"); $err_db = mysql_select_db('bd_amics'); $sql = ("INSERT INTO `'".$_SESSION["use"][14]."'` (ID,Amic,PubID) VALUES ('".$_SESSION["person"][14]."', "1", '".$_SESSION["person"][15]."')"); mysql_query("SET NAMES utf8"); mysql_query($sql, $conn); mysql_close(); $conn3 = mysql_connect("localhost","root","Pass"); $err_db3 = mysql_select_db('bd_amics'); $sql3 = ("UPDATE `'".$_SESSION["person"][14]."'` SET Amic="2" WHERE ID='".$_SESSION["use"][14]); mysql_query("SET NAMES utf8"); mysql_query($sql3, $conn3); mysql_close(); Link to comment https://forums.phpfreaks.com/topic/288785-mysql-insert-and-update-error/ Share on other sites More sharing options...
Barand Posted May 26, 2014 Share Posted May 26, 2014 Check for errors. mysql_query($sql, $conn) or die(mysql_error() . "<pre>$sql</pre>"); And use the forum's code tags when posting code. Link to comment https://forums.phpfreaks.com/topic/288785-mysql-insert-and-update-error/#findComment-1480899 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.