Jump to content

Need help with an arrya index


Recommended Posts



<?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'); ?>
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.