php

How should I refactor my class?

Basically I have a class that sends a SOAP request for room information receives a response, it can only handle one room at a time.. eg: class roomParser { private $numRooms; private $adults; private $dailyPrice; public function parse(){} public function send(){} }; $room = new roomParser( $arrival, $departue ); $...

Mysql optimization, muliple select to single select

hi, I have table where I need to select MAX(SUM(total)) of a periods total. SELECT SUM(P.amount) as total FROM bank P WHERE P.ReceivedDate >= '2008-07-28' AND P.ReceivedDate <= '2008-08-31'; SELECT SUM(P.amount) as total FROM bank P WHERE P.ReceivedDate >= '2008-09-01' AND P.ReceivedDate <= '2008-09-28'; SELECT SUM(P.amount) as total...

PHP and MySQL Project Pay

Someone asked me to design a database and implement it using MySQL. Additionally, I am also asked to write PHP scripts so that one can do some "simple" data analysis with the data inside MySQL. It is not very complicated. It is like a school database and I will have to write programs that will retrieve all the classes that a student has ...

how to rebuild PHP 2 dimentional array?

i have 2 dimentional array like this: $day_array = [[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]]; and i want to rebuild like this $day_array = [[1,1,1,1][2,2,2,2][3,3,3,3][4,4,4,4,4][5,5,5,5]]; Any ideas on how to do this? Thanks in advance... ...

POST or GET in XMLHttpRequest

What does post mean in the following? ajaxRequest = new XMLHttpRequest(); ajaxRequest.open("POST", "url" + queryString, true); because i'm not able to access variables using $_POST['var'] from url but with $_REQUEST['var'] I can access value.. ...

How long should a page generation time take in PHP.

Hello, I was searching the web for this but found no satisfying answer. I am not talking about the time it takes the browser to render and display. Only the part where the HTML is generated in the server itself. <?php $script_start = microtime_float(); #CODE echo (microtime_float()-$script_start) ?> What is the accepted/normal time...

Using Ruby or PHP with .NET

Hi, Currently we have a web application written in the providers own proprietary language / framework. Unfortunately, with it's limited syntax and "wonky" architecture its not great to work with. With some really great development platforms out there (.NET, PHP, Ruby - note that I know nothing of PHP or Ruby but i've heard they are gre...

paypal and Php?

I have two ways to check from user: 1.if user input (Amount field < 5(user credit): do update database the remain amount in my database table. 2.if user input(Amount field) > 5(user credit): Do paypal transaction with the submit form. <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" id="payPalForm"> ...

Drupal: How do I modify my menu items' classnames?

I need unique ids or classnames per each item to style them individually - I'm using Drupal 6.1x. ...

How to pass multiple selected (through checkboxes) row ids to a php script in jQuery?

I'm generating an html file which looks like: <tr id="ID001" property1="PROPERTY001"><td><input type="checkbox" name="row_checkbox_ID001"></td><td>...</td><td>...</td></tr> <tr id="ID002" property1="PROPERTY002"><td><input type="checkbox" name="row_checkbox_ID002"></td><td>...</td><td>...</td></tr> When the user select...

Total number of built-in functions in php?

Hi, does any one know how many built in functions are there in PHP (latest version)? Thanks ...

Data truncated for column 'xxxx' at row 1

hi I have just moved a php site to a new server. One of my queries is failing with Data truncated for column 'xxx' ar row 1 message. I checked that this field is float (10,6) type. And the values I provided white updating are not of exactly float(10,6) format and they vary .. like sometimes I put 0 only, or 54.56666 only .. so any idea ...

Regex for adding a versionnumber to .js and .css references in a HTML document

Hi folks, I have a HTML document where I want to automatically have a version number added to all script and style sheet references. the following should be replaced <link ... href="file.css" media="all" /> <script ... src="file.js"></script> <script ... src="http://myhost.com/file.js"&gt;&lt;/script&gt; with that <link ... hre...

php pages integration in drupal

How can we create new php pages in drupal ? ...

When should I close the db connection?

Is it a must to close the connection in PHP script? ...

PHP Programming Blogs

Possible Duplicate: What are good PHP and MySQL type Blogs to read? What are all the PHP blogs that you regularly follow? ...

RegEx for cleanup a string

This RegEx is for cleanup user input from a search form $query = preg_replace("/[^A-Za-z0-9 _.,*&-]/", ' ', $query); I need to add the slash as a valid character too, but if I add it, I get an error. I assume I have to escape it but can't find how to do that $query = preg_replace("/[^A-Za-z0-9 _.,*&-/]/", ' ', $query); // doesn't wor...

Drupal: Enable search form globally?

My search component block has the default settings but for an anonymous user it shows a login area instead of the search component and only until you've logged in do you see it. "Show on every page except the listed pages" and no pages listed.. "Show block for specific roles" - unchecked so all.. ...

Php / Ajax / Jquery data submission approach

I have a table/grid system with a 7 days along the top and the various types of data down the side, now for each type of data against a particular day there's a plus and minus sign so the user can increase or decrease the data occurrences. Now given that there's plenty of data types as well as 7 (for each day) values for each type, what'...

Can not load related tables when executing query from Doctrine_Record

I'm struggling with a very strange problem, and I cannot seem to fix it. Short version When I execute a query from within a Doctrine_Record, it just doesn't seem to work when I try to get a related table. I get an Exception: error: Uncaught PHP Error: Trying to get property of non-object in file D:/Tools/Development/xampp1.7/htdo...