Tuesday, 6 August 2013

Why isn't my script working?

Why isn't my script working?

I am trying to set up a script for my website where a section of text in
tags changes depending on my link using /file.php?s-id=1 but the script I
am using isn't working. The database is named ftvo and the table is named
seriesdb. I have attached a snippet of my code below just with the
database password missing for security reasons:
<?php
$sId = $_GET['s-id'];
$mysqli = new mysqli("localhost", "root", "userpassword", "ftvo");
$sql = "
SELECT id, series
FROM seriesdb
WHERE id = $sId
LIMIT 1
";
$result = $mysqli->query($sql);
$s = mysqli_fetch_array($result, MYSQLI_ASSOC);
mysqli_close($mysqli);
?>
<!DOCTYPE html>
<html>
<head>
<title>No Next Episode</title>
<meta charset="utf-8">
</head>
<body>
<h1 style="color:#FF0000">SITE UNDER CONSTRUCTION</h1>
<a href="/"><h3>Home</h3></a>
<p>We apoligise but there is no more episodes of <? $s['series']; ?>
currently available. Please check back later.</p>
<hr />
<p>This site is owned by <b>TechXtra Web Services</b></p>
</body>
</html>
I can answer any questions regarding my mysql server.
Thanks in advance.

No comments:

Post a Comment