It kind of feels like you are asking to the wrong forum. Maybe go to a Python forum and ask there? This is the PHP forum, which exists for those of us who think PHP is the right language for the job. Asking here if you should change to a different language is like going to a Ford dealership to ask them if you should buy a Chevrolet car...
Do it all in the browser.
a) Retrieve all the data for all your horses (including image urls) from PHP.
b) Store all that data in a javascript array of horse records.
c) Program your page's javascript such that, when a horse is selected from your select element, the horse's data is retrieved from your javascript array of horse records, which includes its image's url.
d) Then you can display that image wherever you want.
Use Ajax.
a) Your initial PHP remains the same.
b) Add an "onchange" event to your select element such that, when a user selects a new horse, a javascript function is invoked.
c) In that function, perform an Ajax call to a (new) PHP script on your server, passing along the selected horse's id (or name, or unique identifier).
d) That new PHP script will receive the selected horse's identifier, retrieve that horse's data from the database and return that data to the javascript function that performed the call.
e) Your javascript function, then, can display the selected horse's data (including its image) wherever you want.
Both methods have advantages and disadvantages, but both work perfectly and are valid. Some considerations are:
If you are dealing with a couple dozen horses, the first method might be quicker for you. If your database contains thousands of them though, having your javascript dealing with huge amounts of data might slow down the page.
If you are dealing with a couple dozen horses, the second method might be unnecessarily demanding, because Ajax entails performing additional online requests to your server. If your database contains thousands of records though, Ajax is a much better approach because it makes your page load faster and react faster to user interactions.
As /u/gonatee said, you want to learn Ajax regardless of which approach you take. Ajax is a very useful approach to data transportation on the internet used by virtually everybody nowadays from blogs to banks.
Does this maneuver have a name? I would love to find a tutorial (along with a slow motion or a step-by-step guide of each movement) to acquire that skill. Thanks!
It kind of feels like you are asking to the wrong forum. Maybe go to a Python forum and ask there? This is the PHP forum, which exists for those of us who think PHP is the right language for the job. Asking here if you should change to a different language is like going to a Ford dealership to ask them if you should buy a Chevrolet car...
There are two easy approaches to this:
Do it all in the browser.
a) Retrieve all the data for all your horses (including image urls) from PHP.
b) Store all that data in a javascript array of horse records.
c) Program your page's javascript such that, when a horse is selected from your select element, the horse's data is retrieved from your javascript array of horse records, which includes its image's url.
d) Then you can display that image wherever you want.
Use Ajax.
a) Your initial PHP remains the same.
b) Add an "onchange" event to your select element such that, when a user selects a new horse, a javascript function is invoked.
c) In that function, perform an Ajax call to a (new) PHP script on your server, passing along the selected horse's id (or name, or unique identifier).
d) That new PHP script will receive the selected horse's identifier, retrieve that horse's data from the database and return that data to the javascript function that performed the call.
e) Your javascript function, then, can display the selected horse's data (including its image) wherever you want.
Both methods have advantages and disadvantages, but both work perfectly and are valid. Some considerations are:
As /u/gonatee said, you want to learn Ajax regardless of which approach you take. Ajax is a very useful approach to data transportation on the internet used by virtually everybody nowadays from blogs to banks.
Does this maneuver have a name? I would love to find a tutorial (along with a slow motion or a step-by-step guide of each movement) to acquire that skill. Thanks!
Wow! What an image!
I am a NetBeans fan too. Have been using it since version 6. Every new version (version 12 currently) makes me a fan all over again.