Jump to content

Colin-uk

Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Colin-uk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks HuggieBear :) But I just realised I posted the wrong code  :-[  Sorry. This is the code i'll be attempting to use: [code] <?php include("dbconnect.php"); $id = $_POST['id']; foreach($_POST as $key => $val) { mysql_query("UPDATE dbname SET $key = '$val' WHERE id = '$id'") or die(mysql_error()); } ?> [/code] Although, im not sure how im going to pass the $id to the script, securely..  :-\
  2. its actually 232 Fields (just counted them :P) Im creating a sortof online profession portfolio builder.. I think I have it figured out now though (ive never fully got my head around arrays and functions like foreach(); and while(); ) does this code look valid? :P [code] <?php include("dbconnect.php"); //db connection foreach($_POST as $key => $val) { mysql_query("INSERT INTO dbname (ID, LinkID, $key) VALUES ('','','$val')") or die(mysql_error()); } ?> [/code] -Colin
  3. hmm that extract function looks pretty handy :) if I use the foreach method do i get pretty much the same results? (the name becomes the variable) Thanks, Colin
  4. Ok so normally when coding something to get values from a form i usually use this code: [code]$varname = $_POST['name']; [/code] so then i can do what i want with $varname but say for example I had 200+ form fields to get input from, would there be anyway of getting the form input without having to type a $varname out for each of them? Im not sure how i could do this so any help would be appreciated :) Thanks, Colin
×
×
  • 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.