hmm......
Ny på MySQL, och får inte detta att fungera......
mysql_query("CREATE TABLE IF NOT EXISTS visitors (id int(11) NOT NULL auto_increment,swedishtime TEXT,browser TEXT,ip VARCHAR(50),referer VARCHAR(50),PRIMARY KEY (id),KEY id (id))");
mysql_query("INSERT INTO visitors SET swedishtime='$swedishtime',browser='$HTTP_USER_AGENT',ip='$REMOTE_ADDR',referer='$HTTP_REFERER'");
De 3 sista fälten blir tomma i databasen, dock fylls variabeln $swedishtime i, varför?
------------------
Mina knäskålar klapprar fortfarande efter Kent-Mustafas trummsolo!
------------------ These are the cries of the carrots, the cries of the carrots! You see, Reverend Maynard, tomorrow is harvest day and to them it is the holocaust.
<?
// CONNECT TO MYSQL AND DATABASE
$connect = mysql_connect("localhost","xxxxx","xxxxx");
$database = mysql_select_db("xxxxx");
function saveVisitorsInfo() {
$timedifference = "8";
$transforme = ($timedifference * 60 * 60);
$year = date("Y", time() + $transforme);
$montharray = array("1","2","3","4","5","6","7","8","9","10","11","12");
$month = date("n", time() + $transforme)-1;
$date = date("j", time() + $transforme);
$time = date("H:i", time() + $transforme);
$swedishtime = "$year $montharray[$month] $date $time";
$createtable = mysql_query("CREATE TABLE IF NOT EXISTS visitors (id int(11) NOT NULL auto_increment, swedishtime TEXT NOT NULL, browser TEXT NOT NULL, ip VARCHAR(15) NOT NULL, referer TEXT NOT NULL, PRIMARY KEY (id), KEY id (id))");
$insertintotable = mysql_query("INSERT INTO visitors SET swedishtime='$swedishtime', browser='$HTTP_USER_AGENT', ip='$REMOTE_ADDR', referer='$HTTP_REFERER'");
}
saveVisitorsInfo();
?>
Tog bort ALPHA II's kod eftersom den dödade allting, och gick tillbaka till ursprunget, samma fel som från början alltså, endast ID:et och swedishtime fylls i korrekt....de andra blir blanka....
------------------
Mina knäskålar klapprar fortfarande efter Kent-Mustafas trummsolo!
Koden ligger inte i en funktion, då? Då måste du globalisera variablerna...
------------------ These are the cries of the carrots, the cries of the carrots! You see, Reverend Maynard, tomorrow is harvest day and to them it is the holocaust.