PHP - Moved: Mysql Join And Count
This topic has been moved to MySQL Help.
http://www.phpfreaks.com/forums/index.php?topic=321929.0 Similar TutorialsThis topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=326580.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=351625.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=348196.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=321443.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=306058.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=313679.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=323935.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=308347.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=344992.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=312690.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=308855.0 Hi guys, I need your help. I am trying to insert the rows in the mysql database as I input the values in the url bar which it would be like this: Code: [Select] www.mysite.com/testupdate.php?user=tester&pass=test&user1=tester&email=me@shitmail.com&ip=myisp However i have got a error which i don't know how to fix it. Error: Column count doesn't match value count at row 1 <?php session_start(); define('DB_HOST', 'localhost'); define('DB_USER', 'mydbusername'); define('DB_PASSWORD', 'mydbpassword'); define('DB_DATABASE', 'mydbname'); $errmsg_arr = array(); $errflag = false; $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } function clean($var){ return mysql_real_escape_string(strip_tags($var)); } $username = clean($_GET['user']); $password = clean($_GET['pass']); $adduser = clean($_GET['user1']); $email = clean($_GET['email']); $IP = clean($_GET['ip']); if($username == '') { $errmsg_arr[] = 'username is missing'; $errflag = true; } if($password == '') { $errmsg_arr[] = 'PASSWORD is missing'; $errflag = true; } if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; echo implode('<br />',$errmsg_arr); } else { $sql = "INSERT INTO `members` (`username`,`email`,`IP`) VALUES ('$adduser','$email','$IP')"; if (!mysql_query($sql,$link)) { die('Error: ' . mysql_error()); } echo "The information have been updated."; } ?> Here's the name of the columns i have got in my database: Code: [Select] username IP I have input the correct columns names, so I can't correct the problem I am getting. Please can you help? This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=331562.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=332358.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=320476.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=355951.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=306275.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=312429.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=313310.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=306846.0 |