Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/12/2023 in all areas

  1. @Barand, thank you! That thing you do -- that putting the "key-back-into-the-array-thing" -- $received[$k] -- got me again! I still don't know how you know when to do this. But it works perfect! Thank you again! Your code appears to work perfectly! Had you not come up with a solution, my next step would have been to use mySQL :-) @jodunno, thank you! Your code worked. The logic you used makes perfect sense now.... but was out of my grasp this past week I've been trying to figure this on out. (I'm sure unintentional, but it is amusing how your variable name "$reckoning" sorta fits right in there with Noah and $ark 😀)
    1 point
  2. or $ark = array( '3 gerbils', '7 fish', '3 gerbils', '1 cat' ); $received = array( '3 gerbils', '7 fish' ); foreach($ark as $j => $expected) { echo $expected; foreach($received as $k => $line) { if($expected == $line) { echo " ARRIVED"; unset ($received[$k], $ark[$j]); // cross them off the lists } } echo "<hr>"; } giving...
    1 point
  3. An easy way to iplement a similar search is to use a datalist. For example Pupil ID : <input type='text' name='name' id='name' list='pupils'> <datalist id="pupils"> <option value="1">Adam Simms</option> <option value="2">Allan Blair</option> <option value="3">Anna Hamilton</option> <option value="4">Anne Bailey</option> <option value="5">Anthony Bell</option> <option value="6">Caroline Freeman</option> <option value="7">David Powell</option> <option value="8">Emma Watson</option> <option value="9">George Wilson</option> <option value="10">Henry Irving</option> <option value="15">Jack Williams</option> <option value="11">Jane Morrison</option> <option value="12">John Patterson</option> <option value="13">John Tully</option> <option value="14">John Watson</option> <option value="16">Margaret Norton</option> <option value="17">Mary Blake</option> <option value="18">Mary Sheldon</option> <option value="19">Mary Whitehouse</option> <option value="20">Michael Grove</option> <option value="21">Peter Adamson</option> <option value="22">Peter Appleby</option> <option value="23">Wayne Jones</option> <option value="24">William Smith</option> </datalist> The list is initially hidden by default. Entering "ma" in the input displays the names that contain "ma" When Margaret is selected, the input field then contains the ID of her record (16)
    1 point
  4. if you are asking how to make the selected option 'sticky', you would output the selected attribute for the option choice that matches any existing gname input value. if you are asking how to narrow down the choices, this is called autocomplete/typeahead and uses javascript and ajax requests to populate a dropdown list with entries from your database that match the portion of text that has been typed in a text input field. you can then just click on the choice you want to complete the entry in the field. there are countless example scripts posted on the web.
    1 point
  5. You'd pass the user's ID as a parameter to the page then use that to filter your query results using a WHERE clause, like in your previous thread.
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • 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.