yep $ary holds the row results
it loops through all the fieldnames of you're select statement and puts the values ($value) into variables of their fieldname ($$key)
so if you have 10 fieldnames you get 10 (in this case select options) if you have 20 fieldnames you get 20 select options
but if...
here a small example where I build up a menu which is generated from the database. you can also use it for inputfields like above
$q_result = mysql_query("SELECT * from contenttable order by coorder");
while ($ary = mysql_fetch_assoc($q_result)) { //one
while (list($key,$val) = each($ary)) {...
perhaps because the variable type private doesn't exist in PHP , if you have some reference in a manual where it's used I would like to see but I can't find it on
http://nl2.php.net/manual/en/language.variables.scope.php
hey I don't know all the options php has to offer so when someone comes...
yep my example is almost the same but differs quite a lot because of the $$ assignment
suppose you have a variable
$test='var1';
then $$test='hallo';
echo $var1;
gives back "hallo"
perhaps is there something wrong with $this, I have never seen that before but I just copied you're code...
$query="SELECT * from artisttable order by arname";
$q_result=mysql_query($query,$conn);
$templist='';
$templist = "<select name=\"agarid\"><option value=\"\">Empty";
while ($ary_stage = mysql_fetch_assoc($q_result)) { //one status
while (list($key,$val) = each($ary_stage)) { $$key = $val; }...
$test=array()
$test['value']="aa" . $my_var . "cc";
$test['text']="My TEST";
and to put the values in an var with the corresponding value you do
while ( list($field, $value) = each ($test))
{
$$field=$value;
}
something like this ??
an awful lot ?? I'm als obusy with sessionvariables in MYSQL and I was wondering that if I want to make my pages multilanguage if it's the best to store all the vars of the textobjects in the session or use include files for it ????
pfff here are some dat functions that retrieve the amount of days. then it's simple to loop through that amount of days add 1 day each time and add them in an array
http://nl2.php.net/manual/en/function.date.php
the slashes are normal to be in front special characters. translated back to html they will show the right sign without a slash ;) only the last statement is good
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.