When I navigate to this url:
site.com/verify.php?key=0000-0000
a 0 or 1 should display, instead I get a syntax error.
It is connecting to the database correctly... Ive tried and tried to make it work, something is missing.
PHP Code:<?php
$key = $_GET['key'];
$trimmed = trim($key); //trim whitespace from the stored variable
mysql_connect("dburl", "username", "password") or die(mysql_error());
mysql_select_db("dbname") or die(mysql_error());
$query = "SELECT * FROM auth WHERE key LIKE '$trimmed'";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo $row['key']. "<br />" . $row['active'];
}
?>








Bookmarks