Jump to content

jdavidbakr

Members
  • Posts

    271
  • Joined

  • Last visited

Everything posted by jdavidbakr

  1. How is he entering the wacky characters? What if you stripped non-ascii characters, or are they pertinent to the document? You could set the collation of the field in the database to ascii_general_ci maybe.
  2. If you've got command line access, that's the easiest way to load a huge db from a mysqldump - mysql the_database < cat backup.sql
  3. The master-data flag is there so you can load the data onto a new slave that will connect to the server you did the dump from, it doesn't track the current slave's position. You might try in your backup script dumping the output of "show slave status;" to the head of your dump. You'd of course have to remove this section before restoring the dump, but it would give you the master log and position at the start of the dump. You don't want to have master-data turned on for regular backups of a slave.
  4. Is he copying and pasting from Word? That's a gauntlet that you don't want to go down if you can help it ... you might be able to find a script that will replace all the wacky characters with html-compatible ones, I don't know. I've had to write my own for this purpose, it was a process of taking the characters one at a time and building some regex to fix it. You might also check to make sure all your character sets match - make sure that apache and mysql are using the same character sets.
  5. It pretty much makes it impossible to do any queries efficiently filtering by the date column. You can do conversions in your query, but you can't use indexes - if you have several thousand rows, for example, and want to find rows between two dates, there is no efficient way to do it - not only will MySQL have to do a full table scan, but it will also have to execute a function individually on each row to convert the varchar to a date in order to compare it to the range you are selecting. I would recommend, if you can, to create a new column that is a DATE type, and run a query to populate that column with your current VARCHAR date, and change your application to store the date in that format. Then you can set up an index on the DATE field, and it will be very easy to do the queries you are trying to do.
  6. That's probably true... this, though: dealers.Dealer_BusinessName LIKE '%" . $BusinessName . "%' is going to do a full table scan I think. If you can change it to this: dealers.Dealer_BusinessName LIKE '" . $BusinessName . "%' and have dealers.Dealer_Business indexed, it should speed up the query. A lot of what to do though depends on the output of the EXPLAIN query.
  7. Maybe use UNION to combine separate statements for each condition?
  8. You mean like this? SELECT COUNT(id) AS c FROM table where x=y or x=z GROUP BY c ORDER BY c LIMIT 20
  9. I think you'll want to group by topic.
  10. Separate your "or" section in parentheses: ... WHERE CLIENTS.CLIENT_ID = REMIND.CLIENT_ID AND (REMIND.R1 BETWEEN NOW() AND DATE_ADD(NOW(),INTERVAL 21 DAY) || REMIND.R2 BETWEEN NOW() AND DATE_ADD(NOW(),INTERVAL 21 DAY) || REMIND.R3 BETWEEN NOW() AND DATE_ADD(NOW(),INTERVAL 21 DAY) || REMIND.R4 BETWEEN NOW() AND DATE_ADD(NOW(),INTERVAL 21 DAY))
  11. Putting functions in your where clause will also take a very long time. You might try, if you can, calculating the range outside of the query. Also, be sure you're using your indexes well - the functions won't, and your "LIKE '%..." won't either. If you can avoid putting the wildcard at the beginning of your "LIKE" clause, and index that field, you'll see an improvement as well.
  12. DIVs default to displaying in block form, which means that they fill the width of the page. I assume that's what your problem is, that the entries are just displaying one on top of the other instead of side-by-side. You're probably wanting to style the DIV in such a way that it allows two to be next to each other. You could try "float: left" and a fixed width, or change your strategy to use tables and close/reopen the <tr> every second entry.
  13. Is there a reason you're not using the DATE or DATETIME field type? What you're trying to do will work much better and be much easier if you do.
  14. If you want to ping the server and load a new page at the same time, then you can actually have the link take you to the php script, then at the end of the script execute a 'header("Location: xxx.html");' command to load the page again.
  15. What is the output of 'show create table users'?
  16. You'll have to either do it the way you're doing, or use some AJAX tricks. If you don't want to take the time to learn ajax, I don't think what you're doing is necessarily a bad way to do it.
  17. It doesn't look like you're executing the "create table" statement, although you probably should create the table outside of your form submission script. If you continue to run into issues, after each query add: echo "<P>".mysql_error()."</P>" and see if you get any output.
  18. localhost will be the server where the script is executing - are you trying to look on the client PC? You can't do that.
  19. Yes, single quotes won't expand your variable. Try changing it to if( file_exists($offline_locn))
  20. Is that a direct copy and paste from your code? This line mailer = new Mailer(''site name', 'email'); has two single quotes before 'site name', which would throw an error, which could break your session_start() if the error is thrown first.
  21. In your browser you should be able to view the cookie. I.e, in Firefox, go to preferences->privacy->show cookies. Find your cookie by tying in your root address in the search box and tell us what shows up under "Site." If you're seeing all your subdomains (assuming that you're restarted the browser and thus cleared out your previous attempts) then something is not working as expected, but it may help identify what might be going on. I wonder if you should leave off the leading "." in the domain so the command is: session_set_cookie_params(0, '/', 'example.net'); I honestly don't know whether that will make a difference or not, though.
  22. Reverse it, the session_set_cookie_params() needs to be before session_start()
  23. Looks right to me. 0 is "until the browser closes" which is the normal setting for session cookies.
  24. Look in your cookies on your browser for the PHP session cookie - I'll bet it's locked to the subdomain it's been assigned from. Look up http://us2.php.net/manual/en/function.session-set-cookie-params.php and see about changing the $domain to be the root domain so the cookie is set in example.com instead of www.example.com.
  25. is www.site the name of the directory? It's looking for the file "./www.site/root/bmet/testing/update/...", not pulling the URL "http://www.site/root/bmet/testing/update/"
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.