I have a databse set up, and I can read all of the other fields, but I cannot get any information out of the "Id" field.
Here is the code:
<?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
/*
********************************************************************************
Gets all dates from your database and set the calendar events html classes (for the layout)
********************************************************************************
*/
$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();
?>
<tr>
<td>
<hr width="%100"></hr>
Last Updated: June 18, 2005
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
Please help,
Thank You