php - Mysql Field Data not displaying when a link is clicked? -
i'm trying data database if link clicked.
i used example codes suggested example -getting mysql field data when link clicked?
but doesn't work when click on link nothing comes up.
main.php
<?php include('conn.php'); $sql2 = "select title addpromo"; $result2 = mysql_query($sql2); echo "<div id=\"links\">\n"; echo "<ul>\n"; while ($row2 = mysql_fetch_assoc($result2)) { echo "<li> <a href=\"fullproject.php?title=\"" . urlencode($row2['title']) . "\">" . htmlentities($row2['title']) . "</a>\n</li>"; } echo "</ul>"; echo "</div>"; ?>
this displaying correct.but when click @ link nothing showing in fullproject.php, blank page.
fullproject.php
<?php // connect server. include('conn.php'); $projectname = isset($_get['title']); $sql1 = "select title addpromo title = '$projectname'"; $result1 = mysql_query($sql1); while ($row1 = mysql_fetch_assoc($result1)) { echo "project name: " . $row1['title'] . "<br />"; echo "<br /> "; } ?>
can me fix this, or other way make this(to data database if link clicked) possible?
change this
main.php
<?php include('conn.php'); $sql2="select title addpromo"; $result2=mysql_query($sql2); echo '<div id="links">'; echo '<ul>'; while($row2 = mysql_fetch_assoc($result2)){ echo '<li><a href="fullproject.php?title='.urlencode($row2['title']).'">'.htmlentities($row2['title']).'</a></li>'; } echo '</ul>'; echo '</div>'; ?>
fullproject.php
<?php if(isset($_get['title'])){ include('conn.php'); $projectname= $_get['title']; $sql1="select title addpromo title = '$projectname'"; $result1=mysql_query($sql1); while($row1 = mysql_fetch_assoc($result1)) { echo "project name: " . $row1['title']. "<br />"; echo "<br /> "; } } ?>
Comments
Post a Comment