This script is for a PAGE LAST UPDATED script that checks a list of websites to find out when each was last updated. Can someone tell me why the following code doesn't work?
// -------------------------- Code for Creating MySQL Database Table ---------------------
Code:
CREATE TABLE urls (
id tinyint(3) unsigned NOT NULL auto_increment,
url text NOT NULL,
dsc varchar(255) NOT NULL default '',
date datetime default NULL,
email varchar(255) NOT NULL default '',
PRIMARY KEY (id)
);
// -------------------------- Code for Checking Last Updated Date -------------------------
PHP Code:
[b][font=Tahoma][size=2]<?php
// DB connection parameters
$db_host="localhost";
$db_user="user";
$db_pass="pass";
$db_name="dbname";
// open database connection
$connection = mysql_connect($db_host, $db_user, $db_pass) or die ("Unable to connect!"); mysql_select_db($db_name);
// generate and execute query
$query1 = "SELECT id, url, date, dsc, email FROM urls";
$result1 = mysql_query($query1, $connection) or die ("Error in query: $query1 . " .mysql_error());
There were no error messages, it just won't update the date in the database. I tried it on both a Windows 2000 runnning Apache/2.0.46 (Win32) PHP/4.3.2 and also a Redhat Linux Server.
Quote:
Originally Posted by YourPHPPro
System specs, php version, and error message would greatly help someone assist you...