0

This is my code:

<?php
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("localhost","root","PASSWORDREMOVED"); 
	
//select which database you want to edit
mysql_select_db("tvguide"); 

//select the table
$result = mysql_query("select * from epair LIMIT 20;");

//grab all the content
while($r=mysql_fetch_array($result))
{	
   //the format is $variable = $r["nameofmysqlcolumn"];
   //modify these to match your mysql table columns
   $programme=$r["programme"];
   $channel=$r["channel"];
   $airdate=$r["airdate"];
   $episode=$r["episode"];
   $setreminder=$r["setreminder"];
echo "<tr><td><b>$programme</b></td><td>showing on $channel</td><td>$airdate</td><td>$episode</td><td>$setreminder</td></tr>";
}
?>

However, for episode I am considering putting it into a separate table, how would I do a query from multiple tables?
My site is similar to this one in content:
http://library.digiguide.com/lib/programmenextshowing/Police%2C+Camera%2C+Action!-12578
http://library.digiguide.com/lib/programmenextshowing/12578&hPage=2

I've got my database to generate 20 records per page but cannot get it to get the next set of 20 records onto another page, and so on, if there's more records, with it dynamically creating the page menus at the footer of the page like in the above link (I'm not sure how to do this!). Also, I cannot get the time and date to display properly - in my database it always ends up displaying the current date and time as a UNIX timestamp.

I'm trying to get it so that the time and date display as for $time variable:

December 15th - 6:00pm

or

6:00pm

Also, is there a way to get the record deleted after a period of time (e.g. 30 minutes/60 minutes, and also replace the field for the programme's air time so that on the day itself it just shows the airtime as in the second example above. Viewing the site links will show you what I mean.)

Also, the above site automatically deletes records after the programme has aired (which is what I am trying to do).
I'm also trying to get my data for the episode guides to be like this
(extracted from a database):
http://library.digiguide.com/lib/episode/Bad+Influences-714868
http://library.digiguide.com/lib/episode/Technocops-756639
and get it to retrieve airdates/airtimes from a table, with it showing a message like this if the episode doesn't air:

Unfortunately the episode "$epname" isn't on the air any time soon.

I'm using Apache, with Phpmyadmin to create this database.

I have been trying to learn this for myself, but would appreciate any help that anyone can offer on making such a site.

My current table layout:

epguide
epdata
episodes
epair
epairlist

All help will be appreciated, and when the site is ready, I will link to it here (it's currently being developed on localhost)

Edited by whitestream6: n/a

2
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by whitestream6
0

I have tried php pagination, it only partially worked, giving me this message:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\www\vhosts\tvsite\tvguide1.php on line 13

However, I'm not fully sure how to paginate this properly so that the code always displays the current page as highlighted, like this link:
http://library.digiguide.com/lib/programmenextshowing/Police%2C+Camera%2C+Action!-12578

The variables are set in the first post on this thread.

I'm new to this PHP pagination so any advice on making this work will be very much appreciated - I have to get the site up by Boxing Day for the person I'm creating the site for!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.