fullyloaded Posted March 13, 2007 Share Posted March 13, 2007 hi if i wanted to insert something to my database will the code be like this? $email2=$_POST['email2']; $tbl_name=users; $sql="INSERT FROM $tbl_name WHERE email='$email2'"; $result=mysql_query($sql) Link to comment https://forums.phpfreaks.com/topic/42465-insert/ Share on other sites More sharing options...
mmarif4u Posted March 13, 2007 Share Posted March 13, 2007 From where u r inserting it and to which table u want to insert,u did not mention the tablename in ur query. Link to comment https://forums.phpfreaks.com/topic/42465-insert/#findComment-206032 Share on other sites More sharing options...
fullyloaded Posted March 13, 2007 Author Share Posted March 13, 2007 hi i want to insert it into (users) and into table (emails) thanks Link to comment https://forums.phpfreaks.com/topic/42465-insert/#findComment-206034 Share on other sites More sharing options...
JasonLewis Posted March 13, 2007 Share Posted March 13, 2007 insert queries look like this: mysql_query("INSERT INTO `tbl` (`column`) VALUES ('column_value')") or die("Error inserting. Error returned: ".mysql_error()); Link to comment https://forums.phpfreaks.com/topic/42465-insert/#findComment-206036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.