If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

creating new version of page each time they click on a link

Ok. So, I've built some tables in MySQL, a list of mammals, amphibians and reptiles.

When people visit the Mammals page (mammals.php), I want there to be a list of Mammal common names (common_name), and if they click on that common_name, a new version of mammals.php is displayed that writes all the info we have for that specific mammal.

I know how to write the list of mammal common names. I know how to write all the info for that mammal to a static page.

However, I can't figure out how to make clicking the echo'd common_name a link to a new instance of mammal.php.

I really don't want to make 100+ pages, one for each mammal, amphibian and reptile. I want to create a function that can be used for all three.

There must be a simple way to use 'common_name' in the naming paradigm for the on-click variable, such as $Common_Name = $result, but one that creates a unique instance of that variable on-click, so that the function can use that info to compare it to the table values and WHERE they are equal, write a new instance of the page.

No, this is not for an assignment. This is for a professor's side project website. Yeay me

did not work

Success!

At least in part.

Now it doesn't recognize the comparison of common_name to $name in show.php, because it wants to change all spaces in that name to "%20", like "Box Turtle" becomes "Box%20Turtle", so when we select where common_name is equal to $name, they are different, so it doesn't list anything.

Well, I tested the value of $name by echoing it before writing the table, and $name does not contain the %20, just regular spaces, so no worries there. However, it still is pulling no value for the comparison of common_name and $name. I'll keep puttering.

You should also know that you can combine, or JOIN tables when doing queries.
I didn't mention that before because it seems like you're a total beginner. What
you're doing now with separate queries is fine. You'll discover more advanced things
as time goes by.