tomtek1990 Posted March 8, 2010 Share Posted March 8, 2010 Hi All I am new to PHP and i am trying to create a dynamicaly generated page for a localhost site i am making. I have the databases working fine but i would like to be able to click on a button eg View and have it take me to a different page Below is the code i have so far please help (IF YOU NEED MORE INFO PLEASE JUST ASK) Thanks in advance Database Page (Section) { echo "<tr>"; echo "<td><center>" . $row['ID'] . "</td>"; echo "<td>" . $row['Title'] . "</td>"; echo "<td><center>" . $row['Certificate'] . "</td>"; echo "<td>" . $row['Director'] . "</td>"; echo "<td><center>" . $row['Released'] . "</td>"; echo "<td><center>" . $row['Notes'] . "</td>"; echo "<td><a href=\"View.php?id=".$row[iD]."\">View</a>"; echo "</tr>"; } Dynamic Page <?php $db = mysql_connect("", "", ""); mysql_select_db("",$db); $result = mysql_query("SELECT * FROM WHERE id=$ID",$db); $row = mysql_fetch_array($result); echo "Title: ".$row["Title"]; ?> I have removed the Database details My Columns are - Title , Director, Certficate, Released and Notes Please Help Guys Thank you Link to comment https://forums.phpfreaks.com/topic/194535-dynamic-page/ Share on other sites More sharing options...
tomtek1990 Posted March 8, 2010 Author Share Posted March 8, 2010 BTW when i click the View Button a page loads with the wanted result in the address bar I.E it says View.php?id=14 then it show Title: with no results from the Database Please Help Link to comment https://forums.phpfreaks.com/topic/194535-dynamic-page/#findComment-1023148 Share on other sites More sharing options...
MatthewJ Posted March 8, 2010 Share Posted March 8, 2010 Did you take the table name out for posting, or is it just missing? If that isn't it, you will probably want to post some more of the code as this looks okay. Link to comment https://forums.phpfreaks.com/topic/194535-dynamic-page/#findComment-1023150 Share on other sites More sharing options...
tomtek1990 Posted March 8, 2010 Author Share Posted March 8, 2010 Yes i have removed them for posting. I thought that also, so i just wanted to check with people with more knowledge on the subject Any ideas of what i could change Thanks for your help Link to comment https://forums.phpfreaks.com/topic/194535-dynamic-page/#findComment-1023151 Share on other sites More sharing options...
Tripic Posted March 8, 2010 Share Posted March 8, 2010 HAve you checked your database to make sure the corosponding id exist I have had a problem with that before when i kept playing with my table and then deleting it then when i went to setup the dynamic page the first 12 ids where used up and deleted Link to comment https://forums.phpfreaks.com/topic/194535-dynamic-page/#findComment-1023157 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.