Jump to content

henryhenry

Members
  • Content Count

    75
  • Joined

  • Last visited

Community Reputation

0 Neutral

About henryhenry

  • Rank
    Newbie

Profile Information

  • Location
    UK
  1. Hi OK. Here's all the functions for my analytics. I have used snippets from various locations to put it together. Please note I use PHP to generate the js file hence the small amounts of <?php ?>. Thanks for your help!//-------------------ANALYTICS--------------------------//var xmlHttp; //ajax objectvar vapk; //the visitor pk which is retrieved on entry and used on exit to updatevar listeners = []; //arrayfunction listenAllLinks() { if (!document.getElementsByTagName) return false; // find links in document aLinks = document.getElementsByTagName('a'); // if link does have a id a
  2. Hi AllI'm using AJAX in an analytics script. All works nicely in Firefox and the script loads my php script which records some information in the database. The part with the error in IE is the part which adds the events to the anchor elements. The error message from IE is:Line 335: Object doesn't support this property or method.The javascript line this refers to (I have confirmed this 100% even though line ref is wrong) is as follows: links = document.getElementsByTagName('a'); As you can imagine I've tried looking for standard IE bugs for this type of line but nothing comes up. Some thought
  3. HiI'm trying to track links clicked. I am using PHP and MySQL to store the referer in the database then I have an onmousedown event on all links which calls a php script through AJAX. This script updates the database to add the link that the user has clicked on for that page.When I test the setup, I find that if I trigger the onmousedown event without clicking the link (ie click then move the cursor away), the script runs nicely and records the correct information. When I click for real, the script doesn't seemt finish running so the information is lost.Does anyone know how I can delay the
  4. Hi SpeedyzYeah, I do that at the moment, including a script with the mysql_connect() in it. I wondered if it's faster (in terms of performance) to use the object method?
  5. Thanks Yoshida!As an add on I am wondering whether to make the effort to convert to object-style for mysql stuff. I only just learnt object-style and I'm not really looking to spend hours converting all my connection bits to object style but if it speeds things up a lot then I might. Any opinions?
  6. Hello!I'm trying to choose the best method to optimise my site when connecting to a mysql database.The options that I can work out are:1. persistent connection (ie mysql_pconnect())2. normal connection - open at top of page, close at end of page3. open and close connection every time a query is performedMy site is pretty normal and I think I'm running about 20 or 30 queries on every page. (maybe that's not normal though?).I have been using the second option on that list. The site seems pretty slow and I've got the queries quite well optimised with lots of indicies, so I am thinking that the s
  7. henryhenry

    Links in CSS

    I think server-side scripting is the answer. For example you can just make a header, footer and menu and then include one file on every page. That way you're saving yourself lots of trouble changing every link.Eg. http://www.w3schools.com/php/php_includes.asp
  8. henryhenry

    im having truble

    HelloI was about to post a suggestion but I re-read your updated post. I have to agree with S@m... you need to be a bit nicer when people are giving out free advice.Good luckHenry
  9. I have to say I've never found using height:100% will actually work very well. What do you want it 100% of? And I think it's treated quite differently in different browsers. Agree with the 800x600 statement. My solution is to fix the width at a minimum to the width of the leftbar and the content then you get similar proportions to the 1024x800.Also I'm a bit confused as to why you use overflow:hidden on almost every tag. I think that's going to make your layout less fluid because if the content is more than the size of the div (as you define in your css) then the extra content will be hid
  10. Hopefully this hasn't double-posted...MySQL stores database information in (at least in my version (5.1 I think) ) a database called 'information_schema'. You can select all the table names with this query:SELECT table_name FROM tables;(you must select the correct database with "USE information_schema")You could use SQL to select only the tables that start with 'mots_' or whatever your tables are called. Or you could get them all and do that with PHP.I think mma_fighter's method is very clever for the loop. I used a less clever method with a switch in a function when I did something like th
  11. It sounds like you could get it working by improving the database structure - you could have the data recorded into one database table rather than two seperate tables in seperate databases. If you explain the problem more clearly and give some more information then it would be easier to think of solutions.
  12. Here's the php.net page http://www.php.net/manual/en/function.date.php with all the options for date.If you use firefox, create a search on the functions list (ie right click on the search input at the top right and select 'Add a keyword for this search'). Then you can search php functions from the address bar - much quicker!
  13. You want an SQL query that combines two columns from seperate databases into the same column?! Can't imagine why... Perhaps get both columns in seperate queries and use php to combine the data into an array? Then you don't have to worry about complex SQL joins, you just do two simple queries and use array_merge() with the results.You should probably post this on the SQL board as you'll get more responses.Henry
  14. I found some php functions have a character limit for the parameters. Maybe mysql_query can only take a certain number of characters in each parameter. In this case your query with two md5 values may have exceeded the limit. When you removed the password, the number of characters might have been low enough. If you substitute with a variable it might work?
  15. Maybe there should be a 'why not' statement in PHP?! That would be fun! Uh. I literally just did something like your doing. I put the 'LIKE' statements into an array so : $likes= array();foreach ($values as $k=>$v) { if (isset($_GET['this'])) { $this= $_GET['this']; likes[]= "word LIKE '$this'"; } elseif ...} then in the query you use implode(" AND ", $likes)or you can change to OR (can't mix with this method) if the likes are optionalso something like $sql= "SELECT col FROM table WHERE ".implode(" AND ", $likes); This method I suppose isn't simpler as you're using more loops
×
×
  • Create New...