php

How to display a MySQL database record only once when duplicates exist in PHP?

Suppose my db looks like this: id | person_id | hobby | time ----------------------------------- 1 | 67 | golf | mon 2 | 33 | reading | tues 3 | 67 | baseball | fri 4 | 67 | golf | sun I want to display a list of all the hobbies of person with id 67 on a page. If I do this: ...

Algorithm to stop flickering (clear box and re-populate) when adding text

Hey all, I was wondering if there's a some algorithm or resource that will look at the changes made from an AJAX request and not update the whole box (causing a flicker) but just add/remove the changes made. This is specifically used with the keypress command. A good example is stack overflows "preview" it doesn't flicker when you ad...

Why the remote validation doesn't work?

Hello all, I follow the demo http://jquery.bassistance.de/validate/demo/marketo/ and met some problems to achieve the same remote validation function. Here is HTML I used. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-200000126/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://...

How can I order mysql results in the same sequence as my OR statements?

I have an array of IDs that are already sorted in descending order as to their relevancy, but I need to make a query to get the details of each ID. How can I get the results to return so that they are in the order of my Where statement? SELECT DISTINCT `content_object_set_instances`.`id` AS content_object_set_instance_id, `content_obje...

What is the best OO Design Pattern for handling Windows Registry (or filesystem) objects?

I'm building a class or two based on StdRegProv to handle Windows Registry via PHP's COM class. For reference to all known StdRegProv methods and types, see: http://msdn.microsoft.com/en-us/library/aa393664%28v=VS.85%29.aspx. (Don't even get me started on the fact that I have to know what Reg type a named value is just to get or set i...

any free php ides that offers these features

written in c++ Important highlighter php, html, css, javascript Important Easy Code Navigation Important hinting Important Debugging Optional Remote and Local Project Development Important ftp Important Code collapsing Important Intelligent Auto-complete Important code completion Important these are the features im looking for ide that i...

Need help on a php school problem

Hi everyone. I am currently in a class for the first time for php. I have run into a problem that I am racking my brain over. It consist of having to show function for OTpay. It has a pay rate, total weekly hours, regular pay, overtime pay, and also weekly pay. And it has to have an echo to the page to fill in a submit box when finis...

PHP - time adjust

Hi, I have a set of time in this format. 01:00:04 How can I adjust the time to deduct 4 second from it? Was trying to parse it but is the a quick way to do it using datetime or something? Thanks, Tee ...

php uploader $_FILES undefined

Hello everyone I been trying get php uploader working but having a lot of issues. Here is my code. I'm getting Undefined Index errors on the $_FILES. Am I missing something? I checked the php.ini for the max file size and a list of other things. I checked my tmp folder nothing in it. I was able to use this a little while ago but wh...

Converting a multi-dimensional array (javascript) to JSON (or similar) for transport.

I'm generating a multi-dimensional array in javascript that looks like this (this is the JSON representation of the javascript array, it's not in JSON format): "100": { "40": { "subtotal": "24.99", "turn-around": { "0": "2-4 Business Days", "1": "Next Business Day (Add $15.00)" }, "shipping": { "...

Make Joomla component compatible with SEF/SEO

Hi I have developed a custom component for Joomla 1.5. However the urls when SEF is turned on could look a bit better e.g. display the title rather than the id, how can I make custom urls for my component when SEF for Joomla is turned on? ...

Send browser headers via PHP

How can I send a header to a website as if PHP / Apache is a browser? I'm trying to scrape a site, but it looks like they send a 404 error if it's coming from another server... Or, if you know any other good ways to scrape content from a site? Also, here is my current code: <?php $curl_handle=curl_init(); curl_setopt($curl_han...

Eclipse isn't showing 'New PHP file' even while I'm in the PHP perspective

I use eclipse helios PDT at work and at home . I noticed that on my home installation, eclipse doesn't let me create a new PHP file by right clicking on a folder in the PHP explorer. I have to actually right click=>New and then select other and search for PHP from the dialogbox that shows up. But at work everything is ok and it allows me...

Doctrine Regular vs Fetch join

in doctrine, whats the diff between regular and fetch join? i dont get it just by reading the docs. // regular $query = $em->createQuery("SELECT u FROM User u JOIN u.address a WHERE a.city = 'Berlin'"); $users = $query->getResult(); // fetch $query = $em->createQuery("SELECT u, a FROM User u JOIN u.address a WHERE a.city = 'Berlin'"); ...

How do I create a session on a server in PHP?

Hi, I am trying to make a WDTV Live plugin in linux, which plays a video from a web url. I have a url that is parsed from html source code. The problem is that the url is playable in XBMC, but it can't be play in all the media players. I checked xbmc log, and it looks like that XBMC creates a session to the movie url. Below is log from...

yiiadmin - many-to-many in yii-framework admin interface

Hi, guys! I am currently extending yii-s admin extension, yiiadmin. What would be the easiest way to get a listBox multiple-select field in model-create view, that would display many-to-many relation, for example I have a 'pivot' table that holds these article-category relationships, along with Article and Category tables. I alrea...

json error: parsererror

Hello Guys, am developing a balloon notifications for my social network. i came across this error when there's 2 or more notifications. i checked my json response on jsonlint.com i got error at line 6 JSON response: { "nid": "1101", "img": "<img src=\".\/images\/icons\/he_wall_post_icon.png\">", "notifier": "Sarah O&#03...

Email notificiation on different actions

I'm creating email notification system on my site to send email to the users who has subscribed the article for new comments... I would like to know what is the best way to handle with this situation in php. Should I use the mail function just after the database insertion or there is some better ways. Will it slow down the process of add...

Direct link to Ajax search results

Currently users can search a database using php and ajax with the results shown without a page refresh. This requires uses to enter a search criteria - is it possible to create a direct link to the search results by including the criteria in the url? For example: search.php?keywords=iphone would bring back any results for iphone with...

mailing problem

thanks a lot for helping for previous one. now another is here. this is the response when i try to run the code. <h3>copy of this order has been emailed to you for your records.</h3> <?php echo $html_body; //send email $headers = array(); $headers[]= 'MIME-Versioon: 1.0'; $headers[] = 'Content-type: text/html;charset="iso-8859-1"'; $hea...