php

In Kohana 3, how do you figure out errors made during a query?

I'm using Kohana 3. I'm writing an update query, and it is working for everything except this one section. If I do a var_dump() on the results of $db->execute() I get either a 1 or 0 to say it failed or not. It is failing in this example (returning 0). How can I figure out what error is happening? It justs seems to be silenty failing ...

Handling Multiple Class Operations in a Factory

I have the following Factory Method: public function createErrorNotifier($verbose_output = false, $logging = false) { // First we get the handler $errorHandler = $this->buildErrorHandler(); $errorNotifier = $this->buildErrorNotifier(); // We attach the notifier to the handler $errorHandler->setCallback(array($error...

Whats the best way to sort this array in php?

I cant come up with any sane solution for this problem without resorting to ridiculous combinations of custom functions. Maybe you can provide some fresh thought on this. I have the follow (simplified) array Array ( [0] => Array ( [vid_id] => 420037 [vid_rating] => 2.93827 [vid_quality] =...

PHP - how to create this SOAP XML request?

Hi! I'm trying to figure out how to structure data properly in PHP in order to make a SOAP XML request like this: <typ:saveRequest locationName="example.com"> <typ:datatype owner="ME" class="OPEN"> <typ:order>1</typ:order> <typ:datavalue>[email protected]</typ:datavalue> </typ:datatype> </typ:saveRequest> Th...

PHP - Javabridge Protocol error

Hi Experts, I'm having problem with my PHP - Javabridge. Basically, I'm getting this error "protocol error: , Invalid document end at col 10. Check the back end log for details" when debugging my PHP app, which suppose to run a Java app to do some mathematical analysis. Not sure if this is really a code issue, but since this is happe...

Does a PHP library exist to work with PRC/.mobi files?

I'm writing a WordPress plugin to create an eBook from a selected category in most major eBook formats. I would like to support MobiPocket since that's the format used by the Kindle but I'm not sure how to go about it. From what I've read .mobi files are actually Palm Resource Databases (PRC) but I haven't been able to find a PHP class t...

add days and hours in date/time field and get the updated date/time in php using mysql

I would like to provide the ability for users to submit a datetime value, along with values representing additional days/hours, and then store the datetime that results from adding the two in a mysql database. ...

is it possible to access xml data as a multidimensional array?

I have a basic XML file that I load in my PHP using $xml = simplexml_load_file("file.xml"); I want to be able to access my data using syntax something similar to: $xml[0]['from']; $xml['note']['from']; $xml['from']['email']; I know I can access the data using this: foreach($xml->children() as $child) { echo $child->getName(...

PHP Opcode cached in hard disk?

Hi, I have websites developed in PHP. Im using Opcode cache. But because Opcode cache like eAccelerator or APC is cached in RAM, I needs too much RAM. So Im looking for any project or technique which cache the PHP Opcode in hard disk. Thanks so much (my website is not generate money, so Im thinking about cheaper solution) ...

Regex Question Again!

I really don't know what my problem is lately, but Regex seems to be giving me the most trouble. Very simple thing I need to do, but can't seem to get it: I have a uri that returns either /xmlfeed or /xmlfeed/what/is/this I want to match /xmlfeed on any occasion. I've tried many variations of the following: preg_match('/(\/.*?)\/...

PHP MYSQL: Insert "+" sign in MYSQL using PHP

when i insert let say: mysql_query("insert into table1 (title) values (\"date + book\")"); the "+" sign is converted to a space. so it became "date   book" not "date + book" what should i do to insert it as it is. but if i directly query this to MYSQL it accept it as it is.. please clear my confusion.. thanks "UPDATE campus_bookinf...

Escaping double quotes (PHP)

I want to escape double quotes from this string: <li><a href="the_permalink()">the_title()</a></li> The following works fine: echo '<li><a href="'; echo the_permalink(); echo '">'; echo the_title(); echo '</a></li>'; ... but how do I get them all in one single statement? Thanks ...

abstract class conflict in php

I have this class: abstract class Hotel { protected $util; function __construct() { $this->util = new Utility(); } function add(Validate $data, Model_Hotel $hotel){} function delete(){} function upload_image(array $imagedetails, $hotel_id){} } and a class that extends it class Premium extends ...

I am displaying a list of categories in ASC order."OTHERS" is also one of the category. I need to display all categories in ASC ORDER and "OTHERS" in last .

I am displaying a list of categories in ASC order."OTHERS" is also one of the category. I need to display all categories in ASC ORDER and "OTHERS" in last . This is done by using PHP and MYSQL. TABLE STRUCTURE tale name: categories id categoryname 1 APPLE 2 BANANA 3 Strawberry 4 Other 5 grape For example: the above is the...

unmanaged VPS account; Beginners questions

I have a classified website which uses MySQL, PHP, Solr (java) etc etc... I wonder where I should start after purchasing a VPS package from my provider. There are first of all several packages, I am going with Linux because as far as I know it is the most stable system. But I have never used Linux before! What is Ubuntu, and which ver...

Odd, nondescript error [an error occurred while processing this directive]

I have been migrating a client's website from a Bluehost account to my own cPanel/WHM setup. I used the cPanel 'Backup Wizard' to create the export .tar (composed of home directory and mysql files, amoung some other things...) I suppose it's possible this is the problem, except that I didn't use the wizard to import the information, I ju...

Warning: Cannot modify header information - headers already sent

Hello. I get the errormessage: Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\json.php:1) I know this errormessage will come, if I wrote something and want to send later an header information. But in this case I don't write anything. Here is my code starting at line 1. <? header("...

Get query back from PDO prepared statement

Is there a way to retrieve the query that was used to generate a PDO Prepared statement object? ...

How to do fulltext search with doctrine?

WHERE column = value ->add(column, value); WHERE column <> value ->add(column, value, Criteria::NOT_EQUAL); Other Comparison Operators > , < Criteria::GREATER_THAN, Criteria::LESS_THAN >=, <= Criteria::GREATER_EQUAL, Criteria::LESS_EQUAL IS NULL, IS NOT NULL Criteria::ISNULL, Criteria::ISNOTNULL LIKE, ILIKE Criteria::LIK...

OOP functionname acting as __construct when its the same name as the class

Bit long title, comes down to this: <?php class error { public function error($errormsg = false, $line = false) { echo 'errormsg: '.$errormsg.' on line: '.$line; } } ?> When i call this class in another file, with for example: <?php $error = new error; ?> It already execut...