Jump to content

Archived

This topic is now archived and is closed to further replies.

btkaruna

in help in $_POST[$i."1"]

Recommended Posts

hi,

i have to modify my sql query.following is my sql statement

insert into quartperformfigures (iQuater,dValue) values ('1','".$_POST[$i."1"]."')";

what does '".$_POST[$i."1"]."' hold is it array type value? need help to analyse this.thankyou


karuna

Share this post


Link to post
Share on other sites
[quote]what does '".$_POST[$i."1"]."' hold is it array type value?[/quote]

It is an array element.  It can hold any number of things, but it would appear in your case to most likely be either a string or number.

Share this post


Link to post
Share on other sites
A good way to know what it holds is:

[code=php:0]var_dump($_POST[$i."1"]);[/code]

Share this post


Link to post
Share on other sites
the $_POST array is an array that holds all of your submitted values from your form. the stuff inside the [] points to which position in the array. the $i."1" is taking the value of $i and concactonating 1 to it.  I assume that there is a loop where $i is incremented or something, so one one of those iterations of the loop, it might actually look like $_POST[11], $_POST[21], $_POST[31], etc... those being the 12th, 22nd, and 32nd positions in the $_POST array (because arrays start at zero, not 1). 

What value the $_POST[11] (example) holds can be anything.  Look at the form you got the posted info from.  it's being inserted into your dValue column in your db so that might help you.

Share this post


Link to post
Share on other sites

×

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.