1st off, I cannot pull the ID field from my database, but that is not the most important issue here. I create a link to "whatever.php" and add "?id=" to the end, and then tack on what is supposed to be the id, but is a work arround for now. The link is coded into my page, but when I click on it, I get a "404, page not found" error. Then, after that, even when I type the page address in the bar, I get the same error. (prior to clicking the link, I could browse there and the page worked just fine.)
Here is the code on the "sending" page:
<?php
/*
********************************************************************************
Please set the MySQL connection variables below, according to your configuration
********************************************************************************
*/
$dbhost="#######"; // the url of your MySQL Server
$dbuser="######"; // the username of your MySQL Server
$dbpass="#######"; // the password of your MySQL Server
$dbname="news"; // the name of your MySQL Database
$tblName="articles"; //the name of your MyQSQL Database Table
$tblID="Id"; // the name of your MySQL Database Table field
$tblDate="Date"; // the name of your MySQL Database Table Date field
$tblSnipit="Snipit"; // the name of your MySQL Date Table Snipit fild
$tblText="Text"; // the name of your MySQL Info Table Text field
/*
********************************************************************************
Please use the following SQL Statement if the Date Field has a type such as 'datetime'
********************************************************************************
*/
$SQL="SELECT UNIX_TIMESTAMP(".$tblDate.") AS ".$tblDate.", ".$tblID.", ".$tblSnipit.", ".$tblText." FROM ".$tblName." ORDER BY ".$tblDate." DESC";
/*
********************************************************************************
Connect to Database and send the query
********************************************************************************
*/
$conID=@mysql_connect($dbhost,$dbuser,$dbpass);
@mysql_select_db($dbname, $conID) or die( "Unable to select database");
$sqlReturn=@mysql_query($SQL) or die( "Unable to read database");
?>
<table class="body_container">
<tr>
<td>
<table align="left" bordercolor="black" border="1">
<tr>
<td>
<table align="left">
<tr>
<td>
<font size="14">News</font>
<hr width="%100"></hr>
</td>
</tr>
<?php
$num=mysql_numrows($sqlReturn);
$i=$num;
while ($data=@mysql_fetch_array($sqlReturn, MYSQL_BOTH)){
$mysqlID=$i;//$date[$tblID] or die("Failed to read ID");
$mysqlDay=date("j",$data[$tblDate]) or die("Failed to read Date"); // makes a day out of the database date
$mysqlMonth=date("n",$data[$tblDate]) or die("Failed to read Date"); // makes a month out of the database date
$mysqlYear=date("Y",$data[$tblDate]) or die("Failed to read IDDate"); // makes a year out of the database date
$mysqlSnipit=$data[$tblSnipit] or die("Failed to read Snipit");
//$mysqlArticle=$data[$tblText];
$mysqlLink="http://www.mailletime.com/news/bob.php?id=".$mysqlID or die("Failed to set Link"); // gets the article link
$mysqlMonth=getMonthName($mysqlMonth) or die("Failed to select month"); //makes textual month from numbers
echo "<tr><td><a href=\"".$mysqlLink."\" class=\"link_plain\"><font size=\"5\">".$mysqlMonth." ".$mysqlDay.", ".$mysqlYear."</font></a></br>".$mysqlSnipit."...<a href=\"".$mysqlLink."\" class=\"link_more\"> (More)</a></br></td></tr><tr><td><strong></strong></td></tr>";
$i--;
};
mysql_close();
?>
Please help,
Thanks
P.S. If this does not belong in this forum, please let me know