ginerjm Posted June 9, 2015 Share Posted June 9, 2015 One 'uploads' code here by pasting the RELEVANT code inside of php tags - 'php' wrapped in [] to start and [/] to end. Quote Link to comment Share on other sites More sharing options...
hardikspider123 Posted June 9, 2015 Author Share Posted June 9, 2015 <?php require_once("../includes/config.php"); ?> defined('DB_SERVER') ? null : define("DB_SERVER", "test5"); defined('DB_USER') ? null : define("DB_USER", "test1"); defined('DB_PASS') ? null : define("DB_PASS", "password"); defined('DB_NAME') ? null : define("DB_NAME", "DataLog"); <?php require_once "../includes/initialize.php" ?> <?php define('SITE_ROOT', 'C:'.DS.'xampp'.DS.'htdocs'.DS.'PhpProject1'); defined('LIB_PATH') ? null : define('LIB_PATH', SITE_ROOT.DS.'includes'); // load config file first require_once LIB_PATH.DS.'config.php'; ?> ignore this part <?php include_layout_template('header.php'); ?> Quote Link to comment Share on other sites More sharing options...
ginerjm Posted June 9, 2015 Share Posted June 9, 2015 The code you posted is flawed since all those define calls are not in php mode. Furthermore all you have shown us is some 'setup' stuff and no actual business logic. Is there something you want us to examine and help with? Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted June 9, 2015 Share Posted June 9, 2015 well at a glance, you have given your table two different id's and you have not put any value parameters in any of your option elements, you have not assigned a name parameter to your last select element and you are only collecting member id's in your abc[] array element, not the data you have been previously stating. Here's a debugging tip : add the following line at the very top of update3.php (but still after the <?php tag) die(var_dump($_POST)); then fill out your form as you would expect it to be used and submit it. Post up what you get back from the update3.php page. Quote Link to comment Share on other sites More sharing options...
hardikspider123 Posted June 9, 2015 Author Share Posted June 9, 2015 array (size=1) 'abc' => string '' (length=0) I am getting above answer when I do post. What I am trying to do here is I am selecting values from checkbox and trying to update in sql server database. Give me your ideas. Quote Link to comment Share on other sites More sharing options...
Barand Posted June 9, 2015 Share Posted June 9, 2015 ... and you are only collecting member id's in your abc[] array element, not the data you have been previously stating. In other words, wasting our time. Quote Link to comment Share on other sites More sharing options...
hardikspider123 Posted June 9, 2015 Author Share Posted June 9, 2015 Guru I am trying to explain my problem as you said I have provided my code. now you said I am wasting your time. Quote Link to comment Share on other sites More sharing options...
Barand Posted June 9, 2015 Share Posted June 9, 2015 below is value for ($_post['abc']) 0=>'1','xyz','06/08/2015 1=>'2','pqr','07/08/2015 No, it doesn't according to your form code <input id="abc" type="checkbox" name=abc[] " value="' . $row['memberid'] . '" "> That's why. Quote Link to comment Share on other sites More sharing options...
hardikspider123 Posted June 9, 2015 Author Share Posted June 9, 2015 you are right but I was trying to explain my problem in short form so it would not waste your time. Can you please help me? I am getting value for post_abc like this 0=>'3',dave,Read,06/09/2015 its selected value from checkbox. now I want to update selected value in sql server. I am sorry if I am not able to explain you properly. I am beginner. I hope you understand. Appricate your help. Quote Link to comment Share on other sites More sharing options...
Barand Posted June 10, 2015 Share Posted June 10, 2015 It took you until reply #30 to show an accurate version of the POST contents with var_dump($_POST). When you finally did, you chose to show it without any data which was as much use as a chocolate teapot. Now you claim it looks like 0=>'3',dave,Read,06/09/2015 so it looks like an extra element has crept in from somewhere. You also say that you want to update the database. No statement of exactly what that update should do. Do you think we can can read your mind? Sorry but getting the information required to help you is like getting blood out of a stone and life is too short. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.