Jump to content

Recommended Posts

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?
}

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 />";
        }
    }
}

 

 

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?

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']

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?

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.

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!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.