jfiler20 Posted April 6, 2013 Share Posted April 6, 2013 (edited) i have this click tracking php code for displaying on my site: <?php if (!file_exists("config.php")) { header("Location: installer"); } require_once("config.php"); //Connect to database @$con = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if (!$con) { die("Error: Could not connect to database (" . mysql_error() . "). Check your database settings are correct."); } //Check database exists $does_db_exist = mysql_select_db(DB_NAME, $con); if (!$does_db_exist) { die("Error: Database does not exist (" . mysql_error() . "). Check your database settings are correct."); } if (isset($_GET["id"])) { $id = mysql_real_escape_string($_GET["id"]); } else { die("Error: ID cannot be blank."); } //If ID exists, show count or else die $showinfo = mysql_query("SELECT count FROM Data WHERE id = \"$id\""); $showresult = mysql_fetch_assoc($showinfo); if ($showresult != 0) { echo $showresult["count"]; } else { die("Error: ID does not exist."); } mysql_close($con); ?> i want to show the number the file was downloaded with this given code, but its not working: <?php $_GET["id"] = "download1"; include("indication/display.php"); ?> I placed that code in my html but it doesnt show the number any ideas why?? Edited April 6, 2013 by jfiler20 Quote Link to comment https://forums.phpfreaks.com/topic/276624-help-with-this-php-code-for-displaying/ Share on other sites More sharing options...
jcbones Posted April 6, 2013 Share Posted April 6, 2013 Change the query to: //If ID exists, show count or else die if(!$showinfo = mysql_query("SELECT count FROM Data WHERE id = \"$id\"")) { trigger_error(mysql_error()); } Quote Link to comment https://forums.phpfreaks.com/topic/276624-help-with-this-php-code-for-displaying/#findComment-1423336 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.