Link to home
Start Free TrialLog in
Avatar of shoeboxxpc
shoeboxxpc

asked on

dynaimcally loading only a specific row using a URL query line

I am engaged in a dynamic web publishing project and I am trying to get only a specific row in my mysql database to load onto a dynamic template for my dynamic website through the  use of URL query links on my static navigation page.  

My naviagation link looks somthing like this:

<a href="cccc2.php?id=1">

Which is intended to load row # 1 onto my template.

<a href="cccc2.php?id=2"> is supposed to load row #2 and no other rows. What I am getting is just a blank template or stupid excuses.

What I am running is the indigo package on windows 98SE which includes php4 with apache and mysql. The costom template uses the same database that was created for an experimental dixit template.

My template looks somthing like this:

<html><head>

<title>CCCC - Rural New Yorks Enviromental Watchdogs</title>
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("mydixit",$db);
$id = $_GET['id'];
?>
</head><body background="img/woven.gif">
<p>
<div align="center">
  <table border="0" width="100%">
    <tr>
      <td width="100%">
        <p align="center"><font class="TimesRoman24" color="#000000" face="Times New Roman" size="5"><b><i>
        <p class="titre">
        <!--- Title PHP Begins --->
               <?php
                     $db = mysql_connect("localhost", "root");
                      mysql_select_db("mydixit",$db);
                      $id = $_GET['id'];
                      $sql = "SELECT title
                              WHERE 'id'=$id
                              AND $id = $_GET['id']
                              FROM dixit_pages"  
                  $result = mysql_query("SELECT title FROM dixit_pages,$db);
                  echo "<table border=0 td=100%>\n";
                  printf("%s\n",
                  $myrow["title"]);
                  echo "</table>\n";
                  ?>
        <!--- Title PHP Ends --->
      </p></font></td>
    </tr>
  </table>
</div>
<div align="left">
  <table border="0" width="39%">
    <tr>
      <td width="33%"><font class="TimesRoman10" color="#000000" face="Times New Roman"><i>updated:
        </i></font></td>

      <td width="67%"><font class="TimesRoman10" color="#000000" face="Times New Roman"><i>


<!--- Date Posted --->

               <?php

               $db = mysql_connect("localhost", "root");
               mysql_select_db("mydixit",$db);
               $id = $_GET['id'];

               $result = mysql_query(" WHERE id=$id SELECT DATE FROM dixit_pages",$db);

                 echo "<table border=1 td=100%>\n";

                 printf("%s\n",
                  $myrow["DATE"]);


                  echo "</table>\n";

                   ?>




<!--- startDate Ends! --->




</i></font></td>
    </tr>
  </table>
</div>
<p>&nbsp;</p>
<table border="0" width="113%">
  <tr>
    <td width="100%">
      <p align="center"><p class="texte">

<!--- PHP Content Begins! --->
     
     
     
               <?php

               $db = mysql_connect("localhost", "root");
               mysql_select_db("mydixit",$db);
               $id = $_GET['id'];

                $result = mysql_query("WHERE id = $id SELECT content FROM dixit_pages",$db);

 
                  echo "<table border=0 td=100%>\n";
                 

                 printf("%s\n", $myrow["content"]);


                  echo "</table>\n";

                 ?>
     
     
<!--- PHP Content Ends! --->  
     
      </p></td>
  </tr>
</table>
<p align="left"><font class="TimesRoman10" color="#000000" face="Times New Roman" size="2">
<a href="http://www.homestead.com/concernedcitizens/index.html" target="_self">
<i>Concerned Citizens of Cattaragus County </i></a>

If anyone could help me with this it would be greatly appreciated.



ASKER CERTIFIED SOLUTION
Avatar of C7Swill
C7Swill

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial