php

sql query from 3 tables

dear i need to get query from 3 tables i try to show how i need result in picture hope this will explain every thing. ...

International phone number max and min?

What is the max and min digits for an international telephone number? (country code + area code + phone number) ...

how to neglight .com.eu from an string

i have a lot of urls ending with .com,.com.eu,.fr,.hk etc ..i need to filter the domains only end with .com and .fr ... using php.... ...

PHP Coding style - Best practices

Possible Duplicate: Which Coding convention to follow for PHP? After coding for a while similar in terms to the coding style offered by zend, im constantly finding myself getting told to change my code at work. They prefer a different coding style. For example a huge annoyance for them is using: funtction testFunction { }...

How to have different logic for a page and a post within Wordpress?

I am modifying a wordpress template and need to slightly separate rendering logic for a post and a page, specifically in relation to how the date renders out. The problem is that I cannot find any code to do this, I am sure that it exists. Is there a variable that exists within wordpress that tells me whether the item being displayed i...

Create a string version of an array.

I don't know if the title explains it very well, so here's what I'm trying to achieve. With this script people can change the value of configuration variables on the fly like so: Config::write('General.load', array('plugin1','plugin2'), true); In that example, it changes the General.load config variable to an array, and sets the 3rd p...

passing empty query string to php

i have question for query string i have page wehere i pass query string like that abc.php?id=12 some time query sting "id" is not passed like abc.php and some time value of id is empty abc.php?id= and in the above 2 possibilities pages gives error. how to fix this ? ...

How to use an object method as a callback function

I have the below method in a singleton class private function encode($inp) { if (is_array($inp) { return array_map('$this->encode', $inp); } else if is_scalar($inp) { return str_replace('%7E', rawurlencode($inp)); } else { return ''; } } this works fine as an ordinary function function encode($...

php paging problem

i have one php page with paging option i use follwoing sql statement to generate total number of pages $rowsPerPage=25; $pageNum = 1; if(isset($_GET['page'])) { $pageNum = $_GET['page']; } $offset = ($pageNum - 1) * $rowsPerPage; $query = "SELECT COUNT(id) AS numrows FROM TableA" ...

PHP using dirname(__FILE__) on non-dedicated server?

Hi, What I trying to do is to define a constant variable in a config file: DEFINE("PATH", dirname(__FILE__) . "/"); So that, when I want to "include" or redirect, I could do this: include(PATH . "filename.php"); or header("location: " . PATH . "logout/php"); But when I try doing an echo of PATH, I get this result: /home/myDOMA...

How did they do it? Realtime http://trendsmap.com/

Hi all? I wanna know how did they do this site. How did they do it? Realtime http://trendsmap.com/ ...

How to save a Item Object in Magento to get it back later

I want save $this->_getCart()->getItems() And save it so i can work with the Items after checkout! After the checkout i want to write the items backk to the cart. Does anybody has a Idea to proceed? ...

regular expression: Find url from anchor tag

hi to all, i have problem . i want to find out the url form acnchor tag which consist "title" tag in anchor tag. example: <a href="http://www.test.com" title="xyz">this is test</a> how can i match the string and fetch url using regular expression. thanks ...

How to convert difference between dates into years using php.

Hi, I have dates in the format Start and end dates in the format(mm/yyyy). I want to display the difference of the dates in years, months. example: start date 09/2008 end date 07/2010 display should read 1 Year, 10 months. I appreciate any help. Thanks. ...

PHP Convert word to html with COM

Hi, Here is my code: $file='C:/a.doc'; $saveas=__DIR__.'/tmp/a.html'; $word=new COM('word.application'); $document=$word->Documents->Open($file); $document->SaveAs($saveas,8); $word->Quit(); $word=null; echo file_get_contents($saveas); ...

SQL LIMIT return 'zero' - 0 - rows(IN PHP)

Hello, I have an error in this query, when the query returns zero rows. Error Number: 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 '-20,20' at line 3 SELECT pl.name,pl.email FROM players pl JOIN players_bonus pl_b on pl.id = pl_b.id_player WH...

Facebook-Like Activity Stream

I wrote an application, its not a social networking script by any means, but my script does have "user profiles" for it and I'm interested in a SQL/PHP design idea to go about activity streams as seen on Facebook for the users of my script. Activities such as "Joey commented on X's wall." or "Joey, X, Foo like your photo" or "Foo change...

.asp page calls a remote .php page

Hi: I need to send data from an IIS web server A to an Apache web server B. Two servers runs on different physical boxes and have different static IP addresses. There is a processForm.asp running on server A, it processes some data, I wants to send the data to web server B, say let processData.php (on server B) to furthure process the da...

Does the Tumblr write API require encoding on the 'body' of a post?

Hi guys, I'm trying to implement the Tumblr API into an app. I've hacked together their OAuth implementation but I'm having an issue with their write API. When I send a post body with no spaces in, it posts correctly. But if there is a space, I receieve an 'Invalid Oauth parameters'. Below is a rough example - I hope someone can help!...

Where to rollback a transaction in PDO ?

my problem is , i have a database design from this link http://stackoverflow.com/questions/3305825/is-my-database-overdesigned edit* ok maybe useing transaction ? but where should i put the rollback if it fails ? $dbConnect->beginTransaction(); $RegisterInsert = $dbConnect->prepare("INSERT INTO companies ( `name`, `address`, `ema...