Modernvox Posted February 15, 2010 Share Posted February 15, 2010 Hi Guyz, I am nearing the end of my project. A lot of guyz on here have helped me throughout the long process and I am very grateful-believe me! Everything is working as expected and the final part is displaying values from database. The layout i chose is that similar to craigslist, where the user can click on the ads title and it opens in it's own page. What i need: 1. The' title' and 'actual_location' are displayed in the results page as a link 2.User clicks link and another page opens with the remaining info which is $title $location $actual_location $details $email //I would like to make emails anonymous? $flag// This is just a link to flag the listing Here's what I have /////////////////Test category selected///////////////// require_once(db_cred_all.inc); $conn = mysql_connect($dbhost,$dbuser, $password); if (!$conn) { die('Could not connect: ' . mysql_error()); } mysql_select_db($dbname, $conn); $category= isset($_POST['category']); if ($category== "venues") $result = mysql_query(SELECT * FRom venue WHERE state = '$st'"); While($venue = mysql_fetch_array($result)) { echo $title['title'] . " " . $actual_location['actual_location']; echo "<br />"; //////How to only display Title and actual_location initially as a link and than the rest on next page? } Link to comment https://forums.phpfreaks.com/topic/192151-really-need-some-help-with-this-one-guyz/ Share on other sites More sharing options...
Modernvox Posted February 15, 2010 Author Share Posted February 15, 2010 the lather Link to comment https://forums.phpfreaks.com/topic/192151-really-need-some-help-with-this-one-guyz/#findComment-1012681 Share on other sites More sharing options...
wildteen88 Posted February 15, 2010 Share Posted February 15, 2010 File path should be enclosed in quotes. This is wrong require_once(db_cred_all.inc); it should be require_once('db_cred_all.inc'); This portion of code is incorrect $category= isset($_POST['category']); if ($category== "venues") $result = mysql_query(SELECT * FRom venue WHERE state = '$st'"); While($venue = mysql_fetch_array($result)) { echo $title['title'] . " " . $actual_location['actual_location']; echo "<br />"; //////How to only display Title and actual_location initially as a link and than the rest on next page? } It should be if(isset($_POST['category'])) { $category = $_POST['category']; if ($category == "venues") { $result = mysql_query("SELECT * FROM venue WHERE state = '$st'"); While($venue = mysql_fetch_array($result)) { echo $venue['title'] . " " . $venue['actual_location']; echo "<br />"; } } } Link to comment https://forums.phpfreaks.com/topic/192151-really-need-some-help-with-this-one-guyz/#findComment-1012684 Share on other sites More sharing options...
Modernvox Posted February 15, 2010 Author Share Posted February 15, 2010 File path should be enclosed in quotes. This is wrong require_once(db_cred_all.inc); it should be require_once('db_cred_all.inc'); This portion of code is incorrect $category= isset($_POST['category']); if ($category== "venues") $result = mysql_query(SELECT * FRom venue WHERE state = '$st'"); While($venue = mysql_fetch_array($result)) { echo $title['title'] . " " . $actual_location['actual_location']; echo "<br />"; //////How to only display Title and actual_location initially as a link and than the rest on next page? } It should be if(isset($_POST['category'])) { $category = $_POST['category']; if ($category == "venues") { $result = mysql_query("SELECT * FROM venue WHERE state = '$st'"); While($venue = mysql_fetch_array($result)) { echo $venue['title'] . " " . $venue['actual_location']; echo "<br />"; } } } Cool thanks. But how about the link part? Do i just use echo "<a href=\"{$venue[title]}\" target=\"_blank\">{$venue[actual_location]}<font size=\"3\"></font></a><br />"; print "<BR />\n"; How do i print the rest of the fields in the same statement? Link to comment https://forums.phpfreaks.com/topic/192151-really-need-some-help-with-this-one-guyz/#findComment-1012690 Share on other sites More sharing options...
wildteen88 Posted February 15, 2010 Share Posted February 15, 2010 Do i just use echo "<a href=\"{$venue[title]}\" target=\"_blank\">{$venue[actual_location]}<font size=\"3\"></font></a><br />"; print "<BR />\n"; Yes that would be the correct code. However not sure what '<font size=\"3\"></font>' is for. You should use CSS for formatting your text. How do i print the rest of the fields in the same statement? Just echo out the necessary variable, eg $venue['field_name_here'] Link to comment https://forums.phpfreaks.com/topic/192151-really-need-some-help-with-this-one-guyz/#findComment-1012702 Share on other sites More sharing options...
Modernvox Posted February 15, 2010 Author Share Posted February 15, 2010 Do i just use echo "<a href=\"{$venue[title]}\" target=\"_blank\">{$venue[actual_location]}<font size=\"3\"></font></a><br />"; print "<BR />\n"; Yes that would be the correct code. However not sure what '<font size=\"3\"></font>' is for. You should use CSS for formatting your text. How do i print the rest of the fields in the same statement? Just echo out the necessary variable, eg $venue['field_name_here'] Awesome, thanks wildteen. I don't know CSS yet. I have been using a WYSIWYG builder. I mean , I understand how css works , but it seems like a pain in the ass to me. Why bother? Link to comment https://forums.phpfreaks.com/topic/192151-really-need-some-help-with-this-one-guyz/#findComment-1012705 Share on other sites More sharing options...
wildteen88 Posted February 15, 2010 Share Posted February 15, 2010 I understand how css works , but it seems like a pain in the ass to me. Why bother? Its probably a pain the ass to you because you don't understanding it. To me CSS is actually quite simple. I have been using a WYSIWYG builder. I wont say any more. Link to comment https://forums.phpfreaks.com/topic/192151-really-need-some-help-with-this-one-guyz/#findComment-1012744 Share on other sites More sharing options...
Modernvox Posted February 15, 2010 Author Share Posted February 15, 2010 I understand how css works , but it seems like a pain in the ass to me. Why bother? Its probably a pain the ass to you because you don't understanding it. To me CSS is actually quite simple. I have been using a WYSIWYG builder. I wont say any more. LOL. Thanks dude! Link to comment https://forums.phpfreaks.com/topic/192151-really-need-some-help-with-this-one-guyz/#findComment-1012754 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.