Jump to content

codingbenn

Members
  • Posts

    31
  • Joined

  • Last visited

codingbenn's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Say if I had a sentence like; Adam, Floop, 89, 78 and break this up into various strings? This will be a search result so it WILL change. so like change it to; $first $last $num1 $num2 thanks
  2. well I have a mysql with 3 columns which are called ID, firstName, lastName. I want to search for a name and it then return the ID? thanks little bit of the database; ID firstName lastName 100033 Stijn Stijnen 1001 Gábor Király 100143 Frederik Boi 100264 Tomasz Szewczuk 100325 Steeve Joseph-Reinette 100326 Kamel Chafni 100329 Abdoulaye Faye 100330 José Saez 100387 Richard Spong 100391 Laurent Delorge 100470 Michael Ingham 100521 David Noble 100557 Brian Barry-Murphy 100559 Paul McKenna 100578 Richard Cresswell
  3. im not using the database file anymore..just using a formatted text file
  4. ive decided to have the layout different now so this technique is all fine.
  5. my way is still alot simpler..is their anyway I could space out the information my way?
  6. yes but as being very new to PHP myself working out how to connect to a database and then search it and then filter it and then display it is difficult
  7. My code above is alot simpler and shorter than using a database..is there no way to filter it using my code? its just spacing I need to do really I want it to end up like this RESULT 1; Player Name; OVRL: 90 PAC: 90 - DRIB: 90 SHOT: 90 - DEF: 90 PASS: 90 - HEAD: 90 RESULT 2; Player Name; OVRL: 90 PAC: 90 - DRIB: 90 SHOT: 90 - DEF: 90 PASS: 90 - HEAD: 90 RESULT 3; Player Name; OVRL: 90 PAC: 90 - DRIB: 90 SHOT: 90 - DEF: 90 PASS: 90 - HEAD: 90
  8. This is working a treat atm and is only taking seconds to find players; <form method="post"> Enter Player Name: <input type="text" name="playername"> <input type="submit" value="Find ID!"> </form> <br><br><br><center> <?php $search = $_POST["playername"]; $lines = file('h:/cleanedfutplayers.txt'); // Store true when the text is found $found = false; foreach($lines as $line) { if(strpos($line, $search) !== false) { $found = true; echo $line, "<br>"; } } // If the text was not found, show a message if(!$found) { echo "<i>No match found"; } ?> But im getting the end result like this; I wish it would be this easy to seach a JSON file because you can filter that really easily :/
  9. but I created it and saved it in sql browser? I can open it in that? argh
×
×
  • 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.