So I've learned a lot in the last 2 days from you guys on here and I appreciate it greatly! Ya'll are making this project go by much easier and faster...
I looked up on the web how to display an image using a url stored in the database (the field is a text type and I just stored the url as "/images/website/placeholder.jpg")
The problem I am running in to is a bad parse error or synatx. What am I missing? I copied and pasted the added codes from here...
http://php.about.com/od/phpwithmysql/ss/Upload_file_sql_4.htm
Here is my final code for this section of the page (although I repeat this same process in 3 more tables after it).
<?php
//MySQL Database Connect
include 'connect.php';
// First create an html table
echo '<table border="0" cellpadding="1">
<tr>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
</tr>';
// Create a loop to get one row of the returned data at once:
$result = mysql_query("SELECT * FROM ArticleData ORDER BY date DESC LIMIT 0, 1");
$data = mysql_query("SELECT * FROM ArticleData") or die(mysql_error());
while($info = mysql_fetch_array( $data )) {
while( $row = mysql_fetch_assoc($result) ) {
// while continues util the evaluation in () is false
// $row will contain a single row of data say: ID=1,name=Dero,type=BA,code=1234
// each peice of information will be available thru array keys IE $row['id'] will give me the value of 1
// now start printing this information to the browser with a link to the user's profile where their name is
echo '<tr>
<td><a href="Article.php?id='. $row['id'] .'"> Echo <img src=/images/website/".$info['image'] ."></a></td>
<td width="15"> </td>
<td>'. $row['description'] .'</td>
<td width="15"> </td>
<td>'. $row['date'] .'</td>
</td>';
//close the loop
}
// end the html table
echo '</table>';
?>