Jump to content

welch

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

welch's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a bit of a problem. I have a table that contains all the navigation links with ID, Name(input), URL(input_, Display_order(input), and active(checkbox). I loop through these to create an edit table. I am lost what the best method would be to take each row as an array, then update it where id=id. while(false !== $rs = mysql_fetch_array($result)) { $id = $rs["id"]; echo (" <tr> <td width=\"30%\"><input type=\"text\" name=\"name[]\" size=\"30\" value=\"" . $rs["name"] . "\"> </td> <td width=\"40%\"><input type=\"text\" name=\"url[]\" size=\"40\" value=\"". $rs["url"] ."\"> </td> <td width=\"15%\"><input type=\"text\" name=\"display_order[]\" size=\"2\" value=\"".$rs["display_order"]."\"> </td> <td width=\"7%\"><input type=\"checkbox\" name=\"active[]\" value=\"".$rs["id"]."\" "); if($rs["active"] == 1){ echo "checked"; } echo ("></td> <td width=\"7%\"><input type=\"checkbox\" value=\"".$rs["id"]."\" name=\"delete[]\"></td> </tr> "); } So far I have this if($_SERVER['REQUEST_METHOD']=='POST'){ /* Loop through post and add it to array */ $i=0; foreach( $_POST as $pkey => $pval ){ $posted[$i][]=$pkey; $posted[$i][]=$pval; $i++; htmlspecialchars($pval); } /* Loop through the Array and Display the Values */ echo "<b>Echo Keys and Values</b><p>"; for($z=0;$z<$i;$z++){ echo 'The key "'.$posted[$z][0].'" equals value "'.$posted[$z][1].'"<br>'; } /* Loop through each Key and Value and Add it to the String */ echo "<p><b>Create Select Statement</b><p>"; $string = ''; for($z=1;$z<$i - 1;$z++){ $string .= ' and ' . $posted[$z][0] . '="'.$posted[$z][1].'"'; } /* Create the Query */ $querythis = 'UPDATE swappnavigation SET '. $posted[0][0] .'="'. $posted[0][1] .'"'. $string .''; echo $querythis; echo '<br><input type="button" value="Back" onClick="history.go(-1)">'; }
  2. im at a bit loss on how to start a 2 week schedule with php. What would be the best way to generate a table of 2 weeks ahead worth of options? Dec 4th 2007 -------------------------------------------------------------- Date | Am | PM | EV 12 / 4 | 1 | 1 | 1 12 / 5 | 1 | 1 | 1 12 / 6 | 1 | 1 | 1 and so on. Thanks Matt
  3. awesome, appreciated. had no idea where I should start.
  4. I have created a batch record table batch_payment -> id -> date -> name -> detail With this basic setup, i am lost how I can setup a limit within the array to display only 1 date of the list. So if I had 8 payments on jan. 1st and 10 on jan 2nd, it won't display jan 1st 8 times and jan 2nd 10 times, but rather just show each date once. Any ideas?
×
×
  • 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.