Jump to content

Search engine friendly url


tommr

Recommended Posts

Can anyone please help me with my code.

I would like to display the data from another column instead of the id in the url generated by the scirpt.

 

<?php
include('/home/arts/public_html/shows/includes/config.db.php');
if ($link){
$rpp = 10; // results per page
$adjacents = 4;
$page = intval($_GET["page"]);
if(!$page) $page = 1;

$reload = $_SERVER['PHP_SELF'];

$sql = "select * from craft_shows WHERE venue_state='MD' order by start_date ";
$result = mysql_query($sql) or die(mysql_error());

// count total number of appropriate listings:
$tcount = mysql_num_rows($result);
    $date = strftime("%b %d, %Y", strtotime($row['start_date']));

echo "<table class='table7' width='100%' cellpadding='5' cellspacing='1'>";
echo "<tr><td> </td><td>Date</td><td>City</td><td>Show Name</td><td>Attendance</td></tr>";
echo "<tr><td colspan='7'><hr></td></tr>";

// count number of pages:
$tpages = ($tcount) ? ceil($tcount/$rpp) : 1; // total pages, last page number
$date = strftime("%b %d, %Y", strtotime($row['start_date']));
$count = 0;
$i = ($page-1)*$rpp;
while(($count<$rpp) && ($i<$tcount)) {
	mysql_data_seek($result,$i);
	$row = mysql_fetch_array($result);

     $id = $row['id'];
	echo "<tr><td>";
    echo "<a href=\"/show_submits/show_detail.php?id=$id\">Details</a>";
	echo "</td><td>";
	echo strftime('%b %d, %Y', strtotime($row['start_date']));
	echo "</td><td>";
	echo $row['venue_city'];
	echo "</td><td>";
	echo $row['show_name'];
	echo "</td><td>";
	echo $row['num_visitors'];
	echo "</td></tr>";
	$i++;
	$count++;
}
echo "</table>";
echo "<br>";
// call pagination function:
include("pagination1.php");
echo paginate_one($reload, $page, $tpages, $adjacents);
}
?>

Link to comment
Share on other sites

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.