@tonyh when you post code, you need to format it for the forum. Just place 3 backticks ``` on a separate line before the code and again after the code.
Some points that will simplify what you are doing -
don’t echo static markup. Just drop out of php and put the static markup in line.
echo isn’t a function. leave out the ()
the first option/prompt must have an empty string for a value so that you can easily validate it (this would also be required if you make the field ‘required’ in the browser)
you should list out the columns you are SELECTing in a query and only list the columns you are using.
don’t dynamically chose a column in a query, assuming that is what you are doing with the $ras variable, without fully and completely validating that the chosen column is a permitted value.
don’t put external, dynamic values directly into queries, where any sql special character can break the sql query syntax, which is how sql injection is accomplished. use a prepared query instead. if using prepared queries with the mysqli extension seems overly complicated and inconsistent, it is. this would be a good time to switch to the much simpler and more modern PDO extension.
don’t copy variables to other variables for nothing. just use the original variables that data is in.
don’t use three echo statements where one will accomplish the task.
you should always surround attribute values with quotes, to prevent any ‘stop’ character in a value from being able to break the html markup.
you should apply htmlentities() to any dynamic value you output in a html context, to prevent any html entity in a value from being able to break the html markup, which is how cross site scripting is accomplished.
The script is a PHP form for dog owners to make an entry for dogshows
I cleaned the script up a little bit but i can’t the the selected value to follow to the next step / script (the welcome page). I want the selected $rn (breed name), $ri (breed id) and the $rg ( breed group) to follow to the next step but there they are blanc.
Because you haven’t posted the complete code for the form page or the form processing code, we cannot directly help with the problem. There could be a dozen different reasons why what you are doing doesn’t work. We need to see all the relevant code in order to narrow down the possibilities.
Also, please translate and read the first reply in this thread by @Gandalf on how to post code on the forum.
Do all of your variables - $ras, $U_rasval mainly - contain the values that you expect them to? If you execute the query in phpmyadmin using those same values, does the query work?