Jump to content

sunziun

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sunziun's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi TeNDoLLA, what do you suggest to this task automaticly (if possible)?
  2. I was thinking of something like this: $fn_sql="SELECT * FROM $table"; $fn_result=mysql_query($fn_sql); while($fn=mysql_fetch_field($fn_result)){ eval('$' . $fn->name . '=$_POST["' . $fn->name . '"];'); } this is working perfect. for an update query i need the second which contains fname='$name', lname='$lname' etc... to be generated automaticly like above.
  3. Hello, I am new here and try to to learning PHP by doing. This code is in use for now and growing: $id=$_POST['id']; $fname=$_POST['fname']; $lname=$_POST['lname']; $dob=$_POST['dob']; $notes=$_POST['notes']; $class=$_POST['class']; $sql="UPDATE $table SET fname='$fname', lname='$lname', notes='$notes', dob='$dob', class='$class' WHERE id='$id'"; What is required to have the above code like this?: $input_arr = array(); foreach ($_POST as $key => $input_arr) { $_POST[$key] = addslashes($input_arr); } You see how small this is and its very effective
×
×
  • 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.