sam06 Posted July 5, 2008 Share Posted July 5, 2008 Unfortunetly I'm getting errors with this: <?php $cat = $_GET['view']; $user = $_GET['user']; mysql_connect("localhost", "****", "****") or die(mysql_error()); mysql_select_db("*******") or die(mysql_error()); $query = "SELECT * FROM offers WHERE category=$cat"; $result = mysql_query($query) or die(mysql_error()); echo "<table border='0'>"; echo "<tr> <th>Name</th> <th>Description</th></tr>"; while($row = mysql_fetch_array( $result )) { echo "<tr><td>"; echo '.$row['Name'].'; echo "</td><td>"; echo "'.$row['Description'].'"; echo "</td><td>"; echo "'<a href="click.php?id='.$row['id'].'&user=$user">Visit</a>'"; echo "</td></tr>"; } ?> Page: http://www.sam06.tfcph.com/reward/display.php?view=free Ideally is there a way to display it not in a table, but so It shows them under each other, so NAME, under the DESCRIPTION, than under the LINK. Thanks, Sam Link to comment https://forums.phpfreaks.com/topic/113362-solved-simple-error/ Share on other sites More sharing options...
thatsgreat2345 Posted July 5, 2008 Share Posted July 5, 2008 This line echo '.$row['Name'].'; should be echo $row['Name']; unless you want quotes printf("'%s'",$row['Name']); or echo "'$row['Name']'"; plus this line at href= is closing the double quote echo "'<a href="click.php?id='.$row['id'].'&user=$user">Visit</a>'"; Link to comment https://forums.phpfreaks.com/topic/113362-solved-simple-error/#findComment-582403 Share on other sites More sharing options...
sam06 Posted July 5, 2008 Author Share Posted July 5, 2008 Thats Great, Many Thanks. Link to comment https://forums.phpfreaks.com/topic/113362-solved-simple-error/#findComment-582487 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.