Turning On Slow Query Logging?
Background: I paid a young admin set me up on a database server. He installed the basic I needed for the server...at my request...No Cpanel...mysql and apache and some tight security w/o even a domain name to SSH into. Unfortunately, he's a busy kid, and teens sometimes don't realize that people depend on them...and well, I can't really seem to get him to do much so I gave up and figured it's a good way to force me to learn all this myself... Well anyway, now I want to turn on Slow Query logging. But before I do that, I need to know how MySQL is running. Is SQLogging turned on already? Where is it logging to? So first thing I want to look up is, when the server is rebooted, what's the command to restart mysql? No clue. How do I change the setting? And of course, the server is production, so when I make the change, it needs to be quick, it needs to be smooth, and I need to be able to roll back to the previous config if necessary. I'm running Redhat Enterprise.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Can't Turn On Slow Query Logging
long_query_time = 1 log-slow-queries = /var/lib/mysql/slow_queries.log Is the above syntax not correct for enabling slow query logging? All examples I've seen have the dashes in the second variable and underscores in the first. When I restart MySQL with those lines in my.cnf, it fails to start, but writes nothing to its error log. /var/lib/mysql/slow_queries.log exists, is owned by mysql, and has read/write permission.
Turning On Logging
I have a database that has various information submitted to it from the internet. I am having problems with people hacking/submitting info that shouldn't be submitted. I don't know how they are doing it but I though that if I turned on the Logging for that particular DB maybe it would give me some clues i.e. IP addresses, ISP, date/time info, SQL Statement executed etc.What form of logging would I need to turn on?
How Do I Set Query Logging
I have a situation where my database is deleting records. I would like to enable logging but this produces a huge text file. Also I am not sure how to read the results. I am using MySQL 3.23 (the IT department won't upgrade). Can anyone tell me the most efficient way to set logging for a specific database? I just need to monitor whether a process is deleting these records. Also how would I read this information? Are there any known problems like this with MySQL 3.23?
Query Logging?
I cannot get my query logging to work. I put log=hostname.log in my.ini and at some point it WAS recording a log, but it since stopped. I started the service, stopped the service, did everything. I logged into my machine as admin, as the user, did it all again... cant get it to work. I am running mysql 5 as part of the XAMPP stack. I installed it on this machine as admin and can run it as a service, but I cant get the log to work. Any help would be appreciated. I really need to see what SQL is being executed.
Switch Query Logging While The Server Is Running
It would be nice if general query logging could be switched on and off while the MySQL server is running, and not only at startup time. While debugging an application that uses foreign database access libraries, this would be very helpful. One could switch on logging, perform an activity, switch off logging, and look what has happened. Otherwise, the server has to be restarted to change logging, which is a bit annoying...
Slow Query
i have this query on a website/webapp that has expanded beyond all expectation. It now takes nearly 30secs to return results from the database SELECT cl_t.Client_ID, Buyer_1_Title, Buyer_1_Prename, Buyer_1_Surname, Tel_No, Mob_No, Buyer_2_Title, Buyer_2_Prename, Buyer_2_Surname, Email_Add, Price_Max, MAX(activity_t.Date) AS lastcomm FROM cl_t INNER JOIN cl_want_t ON cl_t.Client_ID = cl_want_t.Client_ID AND Agency_Code ='$agencyloggedincode' AND Deleted = 'N' LEFT JOIN activity_t ON Buy_Sell = 'B' AND Ref_No = cl_t.Client_ID WHERE cl_t.Sales_Agent_ID = $agentid GROUP BY cl_t.Client_ID ORDER BY $order The problem is the call to MAX(activity_t.Date) AS lastcomm activity_t holds all known contact with all known clients and as such is a very large table, the call to search through all of these records and return only the date of the last entry for this client is taking the time. If I remove this from the query I get results in 3 seconds. I have indexing on activity_t.Date & activity_t.Ref_No Question, is there a way of doing this quicker within the table I already have, or should I create another table that just holds the last update date for each client, and get the date from this much smaller table.
Why Is This Query Too Slow?
I find this query to be exceptionally slow(around 2.5 seconds), could some tell me why this is so? MySQL SELECT st.profile_views,count( DISTINCT p.ID ) news_submitted, count( DISTINCT pv.ID ) news_voted, count( DISTINCT pcom.ID ) news_commented, u.joined, u.weight FROM users u LEFT JOIN posts p ON p.submitted_user_id = u.user_id LEFT JOIN post_votes pv ON pv.user_id = u.user_id LEFT JOIN post_comments pcom ON pcom.user_id = u.user_id LEFT JOIN stats st ON st.user_id=u.user_id WHERE u.user_id='john' GROUP BY u.user_id I traced the cause to this line count( DISTINCT p.ID ) news_submitted (from LEFT JOIN posts p ON p.submitted_user_id=u.user_id) But when i execute something like this MySQL SELECT count( DISTINCT p.ID ) news_submitted FROM posts WHERE submitted_user_id='john' it is quite fast (around 0.03 seconds) So why does it slow down when i'm joining the above query with 3 other tables ? Should i use INTEGER for user_id instead of string like 'john'?
Slow Query Log
my slow log is catching a slow query, however the timestamp for the query is "0". I also placed a timestamp on the query to echo out to the results page, and it is about 4 thousands of a second. Why is it showing in the slow log?
Slow Query Using NOT IN
I am migrating a MSSQL server to MySQL. I know the following SQL is valid for both servers, but MSSQL finishes execution of the query almost instantly, and MySQL has been running the query for the past ten minutes and still is not finished. There is basically the same amount of data in each database. Does anyone know ....
Slow Query
I have a query that is running really slow !!!! I have joined on Key fields and indexed the tables fully but it is still solw. -------------------------------------------- select d.id, a.signed, u.Forename, u.Surname, d.paid, p.date, d.payment, p.amount, d.acctual from details d join poten a on a.id = d.id left join recieved p on d.id = p.id left join users u on a.signed = u.userid where d.paid > '01-Dec-2005' and d.authorrceived is not null and d.authorrefused is null and ((d.payment starting 'E' or d.payment starting 'e') or (d.payment starting 'Q' or d.payment starting 'q' and p.target = '500')) order by d.paid, a.signed, d.id
Slow Update Query
I have about 2000 update queries to do, which takes about 1 hr on 250,000 rows. My table is getting kinda slow here is the query i am using UPDATE nametable SET sectionname = replace(sectionname,'".$oldsec."','".$sec."'), categoryname = replace(categoryname,'".$oldcat."','".$cat."'), published=Ƈ' where sectionname='".$oldsec."' and categoryname='".$oldcat."' ; I am wondering if the same thing is possible with an insert... on duplicate key statement? I cant seem to get the insert statement to work, but not even sure whether it is appropriate. With this query I am basically finding and replacing some columns based upon another table (within the php script I am using)
Slow Query Log Files
I have edited my.ini file to create a file called slow queries. My problem is that when the server starts up i do not get a full list of all slow queries. Is there anything else i need to change? How else can i come about in getting all queries that took a long time to execute? im using mySQL 5.0.9.
Slow Query Log Not Staying On
I'm running MySQL 4.0.16 on Windows 2003. I just added the mysqld-nt command line option to enable the slow query log, started MySQL, and the option showed up as turned on. Then later I restarted the server, and the slow query log option went back to being turned off. Is this a Windows problem in not remembering the service parameter? Has anyone else seen this?
View Slow Query Log
I searched here, google and MySQL docs but did not find an answer. I'm using MySQL-Front from a Windows platform to administer a remote database. The remote server doesn't have phpMyAdmin or anything like that. MySQL-Front reports 133 Slow Queries and an average of 15 queries per second. But I dont' know how get more information than that.
Query With 3.3million Rows Is Slow?
I'm not that great with MySQL...so I was hoping someone could help me out. The query I'm running is too slow...can anyone tell me what I can do to speed it up..if I can at all? I was wondering if because ZipListMatrix has 3.3 million rows that 8 seconds is all the faster it's going to be. Any help is greatly appreciated! I have already "optimized" the tables.
Help Rewriting A Slow Phpbb Query
I have a "glance" or "Recent Topics" list on my forums that have become fairly complex. I modified an already feature rich glance mod to allow users to select individual forums to exclude from showing topics in the list. As well when users are members of certain forum groups, they see topics from the group forum in the list, and they are highlighted a different colour. The main SQL query to create the list often is showing up in the MySQL Slow_query log and I'm pretty sure is the main cause for the page loading slow. I am no mysql Guru, so I thought I would seek the advice of some to improve or totaly rewrite this slow query. PHP $sql = "SELECT f.forum_id, f.forum_name, t.topic_title, t.topic_id, t.topic_last_post_id, t.topic_poster, t.topic_views, t.topic_replies, t.topic_type, p2.post_time, p2.poster_id, u.username as last_username, u2.username as author_username FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u, " . USERS_TABLE . " u2 WHERE f.forum_id NOT IN (" . $forumsignore . $glance_recent_ignore . ") AND t.forum_id = f.forum_id AND p.post_id = t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND t.topic_moved_id = 0 AND p2.poster_id = u.user_id AND t.topic_poster = u2.user_id ORDER BY t.topic_last_post_id DESC"; $sql .= ($glance_recent_offset) ? " LIMIT " . $glance_recent_offset . ", " . $glance_num_recent : " LIMIT " . $glance_num_recent; The "NOT IN" list varies per user, but here is an example: NOT IN (77,75,76,25,26,37,63,64,66,67,67,1,25,26,37,70,28,75,76,78)
Slow Query W/ Join & Ordering
I am trying to figure out why I have a hugely slow query (~2 seconds in my testing environment). Details are below: It involves two tables, products and vendors. Products is a huge table, so I will only include the (ostensibly!) relevant fields in its description: CREATE TABLE `products` ( `id` int(11) NOT NULL auto_increment, `vendor_id` smallint(6) NOT NULL default Ɔ', `product_code` varchar(255) NOT NULL default '', `internal_name` varchar(255) NOT NULL default '', `lastmodified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `product_code` (`product_code`), KEY `vendor_id` (`vendor_id`) ) ENGINE=MyISAM; Vendors are much more straightforward: CREATE TABLE `vendors` ( `id` smallint(6) NOT NULL auto_increment, `name` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM; The following query executes in no MORE than 0.01 seconds: SELECT DISTINCT p.id , p.product_code , unix_timestamp(p.lastmodified) as lastmodified , p.internal_name FROM products as p ORDER BY p.product_code ASC LIMIT 0, 30; And has the following attributes: +----+-------------+-------+-------+---------------+--------------+---------+------+-------+-----------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+-------+---------------+--------------+---------+------+-------+-----------------+ | 1 | SIMPLE | p | index | NULL | product_code | 257 | NULL | 25124 | Using temporary | +----+-------------+-------+-------+---------------+--------------+---------+------+-------+-----------------+ When I join with the vendors table, so that I can fetch the vendor's name for each product, I use the following query, which takes about 1.88 seconds: SELECT DISTINCT p.id , p.product_code , unix_timestamp(p.lastmodified) as lastmodified , p.internal_name , v.name as vendor_name FROM products as p LEFT JOIN vendors as v ON v.id=p.vendor_id ORDER BY p.product_code ASC LIMIT 0, 30; It has the following characteristics: +----+-------------+-------+--------+---------------+---------+---------+--------------------------+-------+---------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+--------------------------+-------+---------------------------------+ | 1 | SIMPLE | p | ALL | NULL | NULL | NULL | NULL | 25124 | Using temporary; Using filesort | | 1 | SIMPLE | v | eq_ref | PRIMARY | PRIMARY | 2 | te_inventory.p.vendor_id | 1 | | +----+-------------+-------+--------+---------------+---------+---------+--------------------------+-------+---------------------------------+ Note the addition of the filesort. I'm unhappy enough about the temporary, which I don't really understand, but the filesort is, I'm fairly sure, killing me. Closer investigation (or maybe just common sense if you aren't a MySQL newbie like me) shows that the ORDER BY clause is responsible, for when I join without the ORDER BY, my query time goes back down to 0.01 seconds or so: mysql> explain SELECT DISTINCT p.id -> , p.product_code -> , unix_timestamp(p.lastmodified) as lastmodified -> , p.internal_name -> , v.name as vendor_name -> FROM products as p -> LEFT JOIN vendors as v ON v.id=p.vendor_id -> LIMIT 0,30; +----+-------------+-------+--------+---------------+---------+---------+--------------------------+-------+-----------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+--------------------------+-------+-----------------+ | 1 | SIMPLE | p | ALL | NULL | NULL | NULL | NULL | 25124 | Using temporary | | 1 | SIMPLE | v | eq_ref | PRIMARY | PRIMARY | 2 | te_inventory.p.vendor_id | 1 | | +----+-------------+-------+--------+---------------+---------+---------+--------------------------+-------+-----------------+ Any clues on how I can get the execution time to go down when I am sorting? I'm also curious why MySQL is using a temporary table,
Mysql 5.0 - Using My.cnf - Unix / Slow-query-log
I installed mysql 5.0 and need to set up slow-query-log and other logging options. Here is what I did. But I dont see it working yet. 1. cd /var/db/mysql 2. chown mysql slowquery.log 3. touch /usr/local/etc/my.cnf 4. chown mysql /usr/local/etc/my.cnf vi my.cnf [mysqld_safe] -u mysql --log-slow-queries=/var/db/mysql/slowquery.log so now when I type: mysqladmin shutdown and than mysqld_safe & my sql restarts but the log files are not being used. also - how do I know if my my.cnf is being used at all?
Federated Tables Slow? (like 4.5 Hrs For A Query)
I've got a problem with federated tables. I'm using MySQL 5.1 (with InnoDB as the default table type) on a Win2K server, on which I've got four federated tables pointing at four MyISAM tables on a MySQL 4.1.11 server. Of the four tables, three of them run just fine, and I can retrieve data quickly with no problems. The fourth is a sheer pig. While they have different columns, all four tables are roughly as complex as each other, all having the same features and developed by the same team. The most obvious difference, and what I suspect might be the problem, is that the first three tables have between 150 and 1,000 records, the fourth table has closer to 15,000. Still, there isn't that much lag when I'm pulling from the smaller tables, and the lag is really serious when I'm pulling from the larger one; I ran three queries last night to test, and I could pull data from the smaller tables in about 5 minutes, but the larger table took 4.5 hours- possibly because it was joined with two other tables, but the joins on the smaller tables didn't cause this kind of problem. The second obvious difference is the fact that I'm pulling from a MyISAM table into a federated table... from which I would like to store into an InnoDB table, but it ends up timing out quite a bit. Connecting to the database I've federated to isn't a problem. It responds to a PHP frontend lightning-fast. It's just my federated tables that suck so bad. I wouldn't even use federated tables, but I need to pull from the MyISAM database for storing historical records of inventory. What am I doing wrong, and what can I do to speed things up?
Slow Inefficent Query (FIXED)
I have this query which pulls members from a table of 1200 members details, filtering out those without and email address and those that don't want Newsletters, and also any whose email address exists in a second table (emails that have hard bounced previously) My first attempt took an age and returned about 10,000 members, clearly loads of repeated rows My 'final' attempt with a DISTINCT shoved in works perfectly but is really slow, PHPAdmin says it takes 1.1s but on the website the data doesn't appear for over 30s, all the other sundry queries on the same table work nice and quick on the same website using the same php to generate the table of results The googling I've done suggests (to me) that there's nothing wrong with the query but I suspect that there's far too much checking of fields going on from the pre DISTINCT query's results ....
VER VERY VERY Slow MySQL Query HELP URGENTLY NEEDED
I have the following MySQL query, but it is VERY VERY slow and seems to be crashing the server. There are 300,000+ records in the 'tracker' table. SELECT sites.*, SUM(if(tracker.type='view',1,0)) AS numberOfViews, SUM(if(tracker.type='click',1,0)) AS numberOfClicks, SUM(tracker.revenue) AS totalRevenue FROM sites LEFT JOIN tracker ON tracker.site_id = sites.id GROUP BY sites.id ORDER BY sites.domain_name
Why Does The Slow Query Log Show More Rows Than Exist?
# Time: 070528 17:14:57 # User@Host: counter[counter] @ localhost [] # Query_time: 3 Lock_time: 0 Rows_sent: 7 Rows_examined: 120647 SELECT SQL_CACHE `webpageUrl`, `webpageName`, COUNT(*) AS `count`, (COUNT(*) / (SELECT COUNT(*) FROM _1_log)) AS `pct` FROM _1_log GROUP BY `webpageUrl` ORDER BY `count` DESC LIMIT 7; mysql> select count(*) from _1_log; +----------+ | count(*) | +----------+ | 111824 | +----------+ 1 row in set (0.00 sec)
Large Table, Slow Query Question
I have a table with ~800,000 records. I need to grab random rows from the table based on certain criteria. The problem is that average lowest subset to grab the random row is around 200k. Here is what I'm trying to do: There are 4 columns: data,n1,n2, and n3. I need to get the value of the data column based on criteria using the n1-n3 columns. The most common query is SELECT data FROM table WHERE n1 = ? The problem is that n1 can be only 1 of 5 possiblities. When the table is finished being populated there will be roughly 1.5 million records and 250k for each value of n1. Of course, I have an index on each n column. Right now with just the 800k records it can take over a second, sometimes multiple seconds to run the following in order to get a random row from that subset: SELECT COUNT(1) AS total FROM table WHERE n1 = 3; index = random number from 1 to total SELECT data FROM table WHERE n1 = 3 LIMIT index,1; How can I speed this up? I need it to take less than half a second if possible. Thank you.
Turning Mysql Off On Mac?
My friend is running OSX and has mySQL running, she doesn't know why its running or how it got there, how do you turn it off? What are the steps to go through?
Slow Execution For A Left Outer Join Query
Whats likely to be the cause of slow execution for a left outer join query? The original query joins three tables but even if I narrow it down to one it still takes a long time to execute. $query = "select distinct materials.* from materials"; $query .= " left outer join materials_products on materials.material_id = materials_products.material_id"; There's 914 rows in the materials table and 1348 row in the materials_products table Is it likely to take a long time for this amount of data or is there likely to be a problem in the table(s) set up or query?
Turning Off Foreign Key Checks
Is it possible to temporarily turn off foreign key checks in a db? I know how to do it from the mysql prompt but I have a number of scripts using Java, etc which seem to be breaking because of the table ordering with respect to foreign keys does not seem to be honored (tables with FKs are declared before the tables the keys refer to). If there was some way to turn off checking for a db, run all the creation and import scripts I have, then turn the checking back on it would save a ton of effort.
Apostrophes Turning Into Question Marks?
This may be easily resolved but I haven't ever encountered it before. I am entering text into my mysql database that contains apostrophes. This field is generally around 500-800 characters. When I add the information, there are apostrophes but when I go back to use the information, all of the apostrophes have been changed into question marks. Any ideas how to keep the apostrophes? or why they are being changed? Also, if I go through and change all the question marks back to apostrophes, they will stay apostrophes!
Turning Localhost To A Network Server
I have a small home network with two computers. On my computer I am running MySQL 4.1.21-community as localhost. I have only be using this for development work. My husband wants to learn SQL so I would like to be able to have Mysql Query Browser installed on his machine, with him accessing all the databases I have set up on my machine. How do I go about giving him access to my databases? My machine runs Windows XP and his runs Windows 2000.
Turning Off Allowing Multiple Non-unique Rows
I feel lazy and I am busy so i don't want to fix my perl code to only alllow insertion of unique rows. I know mysql is set to allow multiple rows of the same thing but I would like to turn that feature off. Is that possible?
Logging In
I'm having trouble logging into my sql server, I'm running version 4.0 just about anything I type in gives me this error message "Error SQL query: mysql MySQL said: #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql' at line 1 " Can anyone help me with this problem?
Logging
Is there a way to turn on some sort of logging? I am attempting to connect to a db through VB, just learned it and am not sure if I am getting in and not retrieving data or not even getting in yet. Can this be done through the console and then left on?
IIS Logging To Mysql?
Can you setup mysql ODBC so that IIS can log into mysql? if so is there any good article/ instructions on the setup?
MySQL 5 Logging
I've installed MySQL Server 5.0 on Win2K IIS as well as PHP 5.0. PHP works fine, and so does MySQL...the problem is that I can't get the two to talk to each other
Logging On For The First Time
I've downloaded the XP Windows standard version, installed it and logged on without a problem. I've also downloaded the Linux standard version, installed it(Mandriva 2000 powerpack), and attempted to log on. However, I keep getting a message telling me that it can't find a socks in /var(whatever that is).
Logging In To Monitor Thru Dos
I am playing around with logging in and running commands through batch files on a win2000 machine running mysql, I have a password on my db, I am using mysql -h localhost -u root -p to start up the monitor this works, but it asks for a password which kind of kills the automated part of what I am wanting to do, is there a way to include the password on this command? I thought about passing the password using %1, but I haven't done dos in so long that I dont even know if this feature still works, does anybody?
Logging Problem
I have a problem with mysql general log, regarding query logging. I'm running Win2K, mysql 4.1.10 with JBoss 4.0.2. When I turn on logging, the statements executed from JBoss and logged by mysql look like this: SELECT uuid from tablex AS a WHERE a.id = ?; MySQL never logs the parameters of the statements. Can somebody tell me how to turn this on or what I am missing here?
How Do I Enable Logging?
I need to enable MySQL logging. I looked in the my.ini file and did not see any logging options. Where do I turn on logging? I am using Windows.
Logging Into Server
I have a linux box with MySQL. The following fails. If I try to login locally using mysql -u USERNAME -p If I go to another computer on the network and try using the same user name and password by: mysql -h SERVER ADDRESS -u USERNAME -p This login is successful. Does anyone know why the first operation fails?
Logging With Trigger
I am designing a chatsystem with logging-functionality. And i want to handle the logging-stuff within a trigger. As a procedure the code works, so the syntax in ok. As a trigger i get no errors but nothing is logged. create trigger messages_insert before insert on messages for each row begin declare a tinyint(1) unsigned; select logging into a from users where id = 1; if a = 1 then insert into logfile set content = 'A'; end if; end
Logging In / Cookies
I've been writing some code for site I'm creating, and I got stumped this far in. I have my login code, and it works, sorta - the page that displays right after logging in says that I'm logged in, but the I guess the session is destroyed after that. I'm sort of fighting blindly here - I just started learning PHP a few months ago and don't know much about sessions and cookies yet. Here's the code that processes the login form; I originally borrowed it from an open-source browser-based RPG (which is why users are referred to as 'players'), but now only about lines 7-17 are the same. Also, it worked fine for that game, so I don't know what's wrong here. Code:
Logging Into Server
I am running Mac OS X 10.4 (PPC) I have installed MySQL server and have the use account mysql but I have no idea of the password. When the install ran it did not give me the opportunity to set a password and I can not find anywhere that states a default password.
Logging Doesn't Work
I have WinXP, and MySQL 5.0.18 running as a service. I followed the instructions for setting up general query log file (mysqld --log), and the file was created (Nebo.log), but it does not display any logs. This is all I have after executing a few queries: Nebo.log mysqld, Version: 5.0.18-log. started with: Tcp port: 3306 Unix socket: (null) Time Id Command Argument Can anyone offer any help?
Using A Database For Logging
I need to log the number of "brochure Requests" on a per Region, Per date basis. eg for say 20 Regions , have a 366 columns (one per day of the year). Obviously I can write a script to Create all the tables, but it seems kind of clumsy. Do arrays exist in Mysql? It might also be easier to organise it into 52 weeks of 7 days. How do I design the tables?
Stats Not Logging
My stats arnt being logged. Page loads with no errors.. $update = "UPDATE `log` SET hits='hits + 1' WHERE ip='$ip' AND date='$date'"; if (mysql_query($update) or die(mysql_error()) ) { } elseif($logged[username]) { mysql_query("INSERT into log (ip, hits, date, user) VALUES ('$ip', '1', '$date', '$logged[username]'" or die(mysql_error()) ); } else{ mysql_query("INSERT into log (ip, hits, date, user) VALUES ('$ip', '1', '$date', '$user'" or die(mysql_error()) ); }?
|