Name is a variable, how to write value to the database

Source: Internet
Author: User
while (!! $_rows = _fetch_array_list ($_RESULT2)) {?>
 
  
 
  
 
  
 
  
 
  NormalNot normal



This sentence
NormalNot normal

Do not know how to do, name is a variable, how to upload to the database?



Here are the processed statements

 
  $v) {mysql_query ("INSERT into DJJL (HAO,BH,XM,FANGFA,BIAOZHUN,GONGHAO,NAME,TIME,ZT) VALUES (' $hh ', ' $v ', ' {$BB [$i]} ', ' {$CC [$i]} ', ' {$DD [$i]} ', ' $_gh ', ' $name ', ' $_time ', ' {$zt [$i]} ') ' Or Die (' SQL execution failed! '. Mysql_error ());}} Mysql_close (); _alert_location (' Add success! ', ' ksdj.php ');? >




Reply to discussion (solution)

Why do we have to be so complicated?
In the end is the value of N name to enter or pass 1?

If it's a pass, 1 can be directly
mysql_query ("INSERT into Jsy set name =".) $_post[' name ']. "Where BH =". $_post[' bh ');

If multiple passes can:
$str = "";
foreach ($_post as $k + $v) $str. = "$k = $v,";
$sql = "inset into Jsy set". substr ($str, 0,-2). ";";
mysql_query ($sql);

Why do we have to be so complicated?
In the end is the value of N name to enter or pass 1?

If it's a pass, 1 can be directly
mysql_query ("INSERT into Jsy set name =".) $_post[' name ']. "Where BH =". $_post[' bh ');

If multiple passes can:
$str = "";
foreach ($_post as $k + $v) $str. = "$k = $v,";
$sql = "inset into Jsy set". substr ($str, 0,-2). ";";
mysql_query ($sql);




I'm the name of radio, I don't know how to preach. Because of the loop, there are 21 different name radio

Why do we have to be so complicated?
In the end is the value of N name to enter or pass 1?

If it's a pass, 1 can be directly
mysql_query ("INSERT into Jsy set name =".) $_post[' name ']. "Where BH =". $_post[' bh ');

If multiple passes can:
$str = "";
foreach ($_post as $k + $v) $str. = "$k = $v,";
$sql = "inset into Jsy set". substr ($str, 0,-2). ";";
mysql_query ($sql);




At present, my radio so use is $_values, and this is equal to $_rows[' bh ', because this does not repeat, so I think it is no problem to take it as name.

The problem is:

My that $zt=$_post["] inside should how to fill in, there is the following write to the database how to fill. Because of the loop, there are 21 different name radio

But you should know how these 21 sets of data should be put into the database, right?

But you should know how these 21 sets of data should be put into the database, right?



Into the database I know, is $_post[' name name '], now the name is a variable, not very likely to get

How do you put it in the vault? You know, but I don't know.
How can I help you if you don't tell me?

So the name is tried:
$i = 0;
while (!! $_rows = _fetch_array_list ($_RESULT2)) {
............

Normal
Not normal

$i + +;
}

Then after submission:
$zt =$_post[' ZT ']; can participate in traversal.

Add a hidden text box to each row in the page table, and the value corresponds to the name of each row.

Then $name=$_post["Name"]; it's OK.

So the name is tried:
$i = 0;
while (!! $_rows = _fetch_array_list ($_RESULT2)) {
............

Normal
Not normal

$i + +;
}

Then after submission:
$zt =$_post[' ZT ']; can participate in traversal.



Thank you, finally solve my problem, thank you very much!
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.