Hi everyone and thanks for reading!
I have a MySQL database with a table called "lessons". Inside lessons there are about six or seven fields holding information about piano lessons. The table looks like this:
vid int(10) (Primary Key)
title varchar(50)
date date
teaser varchar(500)
description varchar(2000)
vurl varchar(50)
extra varchar(1000)
All I'm wanting to do is retrieve these values and place them where I'd like, so I know the code to do that through the SELECT statement WHERE vid = and then the paramater I pass in the URL.
At the moment I only have one record, so the vid=1 and this works fine. What I'm wanting to do is make a bit of PHP that stops people trying to access records that don't exist, like vid=33 and so on. At the moment it loads the page and displays no values (because there is no record 33!) but i'd rather it realised there was no record 33 and brought up a message saying sorry there is no such record. I've made one that catches if they've removed the ?vid like so:
$vid = $_GET['vid'];
if (!$vid) { echo "<h2>We've Encountered A Problem</h2>\n"; };
die;
Can anyone help me catch these records that don't exist?
Anthony