Good afternoon, I am new to learning PHP and MySQL. After 6 hours of nonstop research I have hit a brick wall. I am in the process of designing a website that will need to pull information from mySQL. I have a test database set up, and working on the layout. What I am wanting to do is when the webpage loads, if the name of the page is Abjurer.html, I want it to load up the information from my database into the page automatically. When doing the php page, instead of actually typing in Abjurers Tunic, I want it to grab the database items that the name of the webpage is. $result = mysql_query("SELECT * FROM Cloth WHERE Name='Abjurers Tunic'"); while($row = mysql_fetch_array($result)) { echo $row['Name'] . " " . $row['Level']; echo "<br />"; } ?> Code (markup): But I cannot find anything specific about being able to do that. Is it possible? If so, any help would be appreciated or direction of a tutorial. Forgive me for being dumb (since I am sure it is a simple answer) and thank you in advance. (Plus you are helping me with this migrane of hitting a brick wall)
Since it's PHP, the name of the page will be Abjurer.php. You can't run PHP code in an HTML page. If you're sending a request from an HTML page to a PHP page (using Javascript), just include the sending page's name in a GET or POST. Then if(isset($_REQUEST['page']) { $result = mysql_query("SELECT * FROM Cloth WHERE Name='$page'"); while($row = mysql_fetch_array($result)) { echo $row['Name'] . " " . $row['Level']; echo "<br />"; } } Code (markup):