-
Posts
2,527 -
Joined
-
Last visited
Everything posted by DeanWhitehouse
-
MySQL dead but subsys locked - Amazon EC2
DeanWhitehouse replied to DeanWhitehouse's topic in MySQL Help
This is a server set up issue not an Amazon issue. We've solved the issue slightly by switching to InnoDB which only locks per row but we still experience crashes regularly. -
Hello, We run a medium Amazon EC2 instance with multiple sites on and we keep experiencing the error when running WordPress. MySQL dead but subsys locked Can someone help define and the error for us and advise on fixes ? Thanks, Dean
-
Forum Board RSS Feeds
DeanWhitehouse replied to DeanWhitehouse's topic in PHPFreaks.com Website Feedback
ah great thank you! -
Are there any plans to add RSS feeds for forum boards ? Cheers, Dean
-
Article Review - Session Caching in PHP
DeanWhitehouse replied to DeanWhitehouse's topic in Miscellaneous
That is true, i'm using the class myself to store user configuration options retrieved from a database. Therefore it is cached from another data source. I wasn't trying to solve a problem per-say, but just create a simple re-usable system for storing such data. -
Article Review - Session Caching in PHP
DeanWhitehouse replied to DeanWhitehouse's topic in Miscellaneous
All caching methods have to store the data in some form of file. I can see how a user could mis-interpret the name as a way to cache a session instead of a way to cache data using sessions, i think that is what you're going for -
Article Review - Session Caching in PHP
DeanWhitehouse replied to DeanWhitehouse's topic in Miscellaneous
Thorpe: It just makes it easier to store items in a session and retrieve them when implementing on a website where you are unsure of the possible $_SESSION index names. It's basically just a few functions to manage a sites session caching instead of a user writing their own. Would only take a few minutes to re-create the functions yourself so I can see how it may seem pointless. ignace: I'm afraid I don't see how the class name is misleading, could you please expand. Thank you for the links I'm not very experienced in OOP design or guidelines such as them so will be good for me to learn. -
I wrote a short article/tutorial about session caching in PHP and was just looking for tips on both my code and my article. Any feedback would be great please. http://www.deanwhitehouse.co.uk/session-caching-v1-0 I also wrote one on how to do cross-domain ajax calls using jquery. http://www.deanwhitehouse.co.uk/cross-domain-request-with-jquery Cheers, Dean
-
Remove UTM tags from URL (regex)
DeanWhitehouse replied to DeanWhitehouse's topic in PHP Coding Help
aha thank you, I'm a bit of a newbie to regex -
Hello all, I'm trying to generate a regex that will remove UTM parameters from my refferrer URLs. <?php //"test" parameter is lost echo preg_replace("/&?utm_(.*)\=[^&]+/","","?utm_source=bottom&utm_medium=widget&test&test&utm_campaign=testcamp"); ?> The regex works on removing the paremeters whilst keeping parameters before and after in tact. However parameters in-between are lost. Any ideas would be great. I'm testing the above code on http://writecodeonline.com/php/
-
solved, didn't realise IE added margins for organised lists :s Cheers
-
Thanks for the reply, afraid not, already tried all that. I've narrowed down the problem to this div style div#core #images { float:left; width:660px; height:248px; padding:2px; border:1px solid #dadada; } div#core { width:827px; margin-left:178px; margin-top:30px; padding:0; } div#core #images ol { padding:0px; display:inline; } div#core #images li { display:inline; } The core div surrounds the main image area and the search box, the spacing appears in the image div area on the left. I can't find any cause or solution :s
-
*bump* sorry guys, still need a solution
-
Hey Guys, Long time no post Here is my problem, i have this page http://development.djw-designs.com/CCC/ in development. I am testing in Chrome, Firefox, Safari and IE 8. In IE8 is displays without problem, however in compatability mode i get a large space on the left hand side of the image and i cannot find a solution to it. Any Ideas? Cheers, Blade280891
-
Advanced Query, not working, and crashed mysql
DeanWhitehouse replied to DeanWhitehouse's topic in MySQL Help
Anyone? -
Advanced Query, not working, and crashed mysql
DeanWhitehouse replied to DeanWhitehouse's topic in MySQL Help
Anyone any ideas/suggestions? -
Advanced Query, not working, and crashed mysql
DeanWhitehouse replied to DeanWhitehouse's topic in MySQL Help
The query isn't stored in a variable, that was just to make it easier to read for anyone viewing the thread -
Erm, dunno much bout this but either Use .htaccess, try googling? Or Make it password protected and use curl to access it? Just throwing ideas out
-
Advanced Query, not working, and crashed mysql
DeanWhitehouse replied to DeanWhitehouse's topic in MySQL Help
Easier to read <?php $query = " SELECT *, MATCH(product_title,product_description,cat_name) AGAINST ('+$query* *+$query' IN BOOLEAN MODE) AS relevance FROM `{$config['tables']['product']}`,category WHERE category.id = (SELECT main_cat_id FROM cat_product WHERE product_id = {$config['tables']['product']}.product_id) AND cat_name LIKE '%".$query."%' OR category.id = (SELECT sub_cat_id FROM cat_product WHERE product_id = {$config['tables']['product']}.product_id) AND cat_name LIKE '%".$query."%' OR product_title LIKE '%".$query."%' OR product_description LIKE '%".$query."%' ".(isset($order) ? $order : "ORDER BY relevance DESC")." ".$limit; ?> -
Ok, a few problems with this query First one, it said it cannot search as the data encoding is different for one of the tables to the other one. I think i have fixed this in mysql but can't be sure as i need this query to be perfect, as we took the server down with it last night :$ Second the query doesn't seem to work as i think it should The Query <?php $query = "SELECT *, MATCH(product_title,product_description,cat_name) AGAINST ('+$query* *+$query' IN BOOLEAN MODE)AS relevance FROM `{$config['tables']['product']}`,category WHERE category.id = (SELECT main_cat_id FROM cat_product WHERE product_id = {$config['tables']['product']}.product_id) AND cat_name LIKE '%".$query."%' OR category.id = (SELECT sub_cat_id FROM cat_product WHERE product_id = {$config['tables']['product']}.product_id) AND cat_name LIKE '%".$query."%' OR product_title LIKE '%".$query."%' OR product_description LIKE '%".$query."%' ".(isset($order) ? $order : "ORDER BY relevance DESC")." ".$limit; I need the query to search two tables; The first table is "{$config['tables']['product']}", here it searches against the product_title and product_description. The second table is categories, here it searches against the cat_name. Now the hard part The cat name to search against needs to be the category the product is in, so it needs to find the products category id from cat_product table then find the category name using the category id then search against the search criteria. Complex Any help and suggestions please? Thanks, Blade
-
Thanks that did it, i think there should be some more documentation/better documentation on the eval function.
-
I have tried using eval already it created a wierd error Using your way it creates these errors trying $left = eval($newspaper['articles']); $left = $left['left']; I get
-
it is, it is printing as a string not an array
-
Thats what print_r($newspaper['articles']); prints The data stored in the db is array("articles" => array("left" => array("article_1" => array("id" => 1,"pos" => 2),"article_2" => array("id" => 2,"pos" => 1),"article_3" => array("id" => 3,"pos" => 3))),array("right" => array("")))
-
Please read my orginal post, i tried print_r and it printed a string "a" not an array. Also echoing arrays will print "Array" not "a"