shwetapandit Posted November 26, 2013 Share Posted November 26, 2013 whwn i tried to print $_GET array it does not print anything while i am sending p_id through URL.Why it is so...... <?php$conn=mysql_connect("localhost","root","")or die(mysql_error());mysql_select_db("regis")or die(mysql_error());$query=mysql_query("SELECT * FROM admin_page")or die(mysql_error());//$row=mysql_fetch_array($query);echo "<table width='500' cellspacing='0' cellpadding='0' border='0'>";echo "<tr align='centre' colspan='1' rowspan='1'><th>p_name</th><th>p_link</th><th>p_content</th></tr>";while($row=mysql_fetch_array($query)){$p_id=$row['p_id'];echo "<tr><td>";$link=$row['p_name'];print "<a href=".'show_page.php?p_id=$p_id'.">" .$row['p_name'] . "</a><br>"; echo "</td><td>";echo $row['p_link'];echo "</td></tr>"; }echo "<tr><td>";echo "</table>";print_r($_GET);?> Quote Link to comment Share on other sites More sharing options...
Solution Psycho Posted November 26, 2013 Solution Share Posted November 26, 2013 <?php $conn = mysql_connect("localhost","root","") or die(mysql_error()); mysql_select_db("regis") or die(mysql_error()); $query = "SELECT * FROM admin_page"; $result = mysql_query($query) or die(mysql_error()); echo "<table width='500' cellspacing='0' cellpadding='0' border='0'>\n"; echo "<tr align='center' colspan='1' rowspan='1'>\n"; echo "<th>p_name</th><th>p_link</th><th>p_content</th>\n" echo "</tr>"; while($row = mysql_fetch_assoc($result)) { echo "<tr>\n"; echo "<td><a href='show_page.php?p_id={$row['p_id']}'>{$row['p_name']}</a></td>\n"; echo "<td>{$row['p_link']}</td>\n"; echo "</tr>\n"; } echo "</table>\n"; echo "<pre>" . print_r($_GET, 1) . "</pre>"; ?> Quote Link to comment Share on other sites More sharing options...
shwetapandit Posted November 26, 2013 Author Share Posted November 26, 2013 <?php $conn = mysql_connect("localhost","root","") or die(mysql_error()); mysql_select_db("regis") or die(mysql_error()); $query = "SELECT * FROM admin_page"; $result = mysql_query($query) or die(mysql_error()); echo "<table width='500' cellspacing='0' cellpadding='0' border='0'>\n"; echo "<tr align='center' colspan='1' rowspan='1'>\n"; echo "<th>p_name</th><th>p_link</th><th>p_content</th>\n" echo "</tr>"; while($row = mysql_fetch_assoc($result)) { echo "<tr>\n"; echo "<td><a href='show_page.php?p_id={$row['p_id']}'>{$row['p_name']}</a></td>\n"; echo "<td>{$row['p_link']}</td>\n"; echo "</tr>\n"; } echo "</table>\n"; echo "<pre>" . print_r($_GET, 1) . "</pre>"; ?> thanks a lot....it works now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.