php

How to calculate percentage of "equal or better" in mysql DB?

Dear All, Figuring out a title for this question was hard, but the following is harder for me. I hope anyone can help. I have a simple MySQL database table. This table is filled with records containing an ID and the number of week-visitors. It has records of 2 year of about 200+ websites. To summarize, I want to be able to know two th...

SELECT 2010-10-24 09:02:46 post as 'Oct 24, 2010 at 9:02AM'

How can I convert my date field from mysql from 2010-10-24 09:02:46 to post on my site as 'Oct 24, 2010 at 9:02AM' (SELECT TIME_FORMAT(`dPostTime`, '%b %e %l:%i %p')) as post_time This won't post the date, just the time. Thanks so much! ...

How to make an "empty" RSS feed

I'm kind of new to rss feeds, but I'm able to create a feed dynamically using PHP and it works great. My problem is that occasionally the feed doesn't have any items (I limit the age of feed items to 60 days, and sometimes nothing has happened in that time). What I would expect to happen is that I just simply wouldn't have any <item>s ...

Printing a single field below

Suppose I do a select like this: select company, location, acnum, bills from table Just how do i output data using php so that the company and location remain at the top and every bill is printed and the acnum is displayed at the bottom. I'm using mysql_fetch_assoc and have gone mad trying. I can go tru every record but cant get one ...

php => desktop informer (Windows)

Hello! I need to find Desktop Information Soft... For example: web-store, after receiving an order => the program must alert manager... Ideal is... program need to periodically requests an php-script for new orders, and if it was => inform a manager UPD. I'm finding something like "reach inform application", with server side developi...

CakepPHP: help with the cakephp comments plugin

Hi I'm trying to use the CakePHP comments plugin found here http://cakedc.com/downloads/view/cakephp_comments_plugin but the instructions are really hard to follow. I've managed to add comments but it's displaying the commentWidget that's not working. I'm getting confused at this part i think To work properly, the component needs ...

[doctrine] Strange problem when using HAVING() and Doctrine_Pager

My program generates this DQL using echo $q->getDql(); reformated for easier reading: SELECT o.*, t.*, COUNT(t.id) AS num_of_reservations FROM Property o LEFT JOIN o.Reservation t WITH t.status=? AND ( (t.start_date<=? AND t.end_date>=?) OR (t.start_date>=? AND t.start_date <= ?) ) GROUP BY o.id HAVING num_of_reservations <...

PHP Propel-gen to zend framework naming convention

I am playing with the build settings in my build.properties file for propel (version 1.5.4) but don't get it right. Example: Table News should have class Model_News in ./Model/News.php class Model_Base_News in ./Model/Base/News.php My main problems: propel adds the project name as a folder between Model and News.php like: /Model/p...

session file naming

The session files are saved at session_save_path().'/sess_'.session_id(). Is 'sess_' hard-coded? If it can be specified, how do I do that? ...

An algorithm to create HTML table from this row data?

I have come unstuck on a relatively (almost) trivial problem. I have a row of data that I want to display in tabular form (HTML). For some reason (possibly long day [again] behind the computer), I am not coming up with any elegant solutions (algorithms) to do this. I have presented some sample data, and how such data would be displayed ...

php Extends three class without interface

I have three class , called A,B,C and another class called X. In this X class I want to access a few function from A, B and C. I know if I want to access the function in one class, I can use: class X extends A { ... } Now I can access all A public functions, but now I want to access the B and C class functions as well. How do I acc...

Free quality synchronization software? (backup software)

I have started working on larger projects using PHP, and I'm realizing how bad it would suck if the virtual machine I'm storing it all on were to crash or get deleted somehow. So I looked into synchronization in Ecplipse and got dissapointed. I was hoping for a function that would save my file to several locations instead of just one. A...

Facebook post on page with PHP SDK

Hi there. I'd like to post on page - throught my site. . I didn't find anything that could help me in documentation. Also none of google results gave mi answer. function post_facebook($data=null){ $result = ""; require_once (ROOT. "/apps/configuration/models/ConfigurationItem.php"); require_once (ROOT . "/compo...

who to fill detail input base on child window popup

I have a parent window for entry transaction that havs customer ID field input. User have to click find button beside it and new window will be opened and user can findout there. Whenever user choose selected customer, the parent will display some information of the customer like name, address may be, and detail of claim. Anybody can sho...

php+zend..pass parameter in request

hello, i want to pass parameter along with my add action.that is if owner in menu item is clicked then "is_owner" should by default get set otherwise reset..along with "add" want to send one more parameter and access it in view.this is request dispatcher.. $router->map('Company', 'Company', array('controller' => 'companies', 'action' =...

PHP Constant open mysql connection safety?

I have a website where at the top of each page I include a page that opens a mysql_connect connection, so I don't have to open up the connection each time I need to modify or insert stuff into the database. Is this safe, or should I open and close each connection once I'm done using it? require_once("../include/mysqlconn.php"); $sql = ...

How to prevent HTML element moving when resizing window?

I have a simple php page, with the main content placed in a table which is centred. I want to place a menu which starts at the upper right corner. The code is like this: echo "<table class=\"center\">"; while($row= mysql_fetch_array($query)) { echo "<tr>"; echo "<td>"; ... content... echo "</t...

php regex problem

if(strlen(trim($steamid)) != 0) { $regex = "/^STEAM_0:(0|1):[0-9]{1}[0-9]{0,8}$/"; if(!ereg($regex, $ssteamid)){ echo "STEAM ID invalida"; } } Hi, my problem is that this isn't working as it should. STEAM ID's have maximum of 18 characters and ...

How to implement template logic in PHP.

Having my first attempt with PHP templates and i'm a bit confused separating business with presentation logic. I've choosen Dwoo as my template engine as you will see on the example below but my question is independent of Dwoo. I see that what im doing isn't a good logic, it'll confuse the designer and it doesn't really separates PHP/HT...

Form helpers vs html form?

Hello, What is the difference between using form helpers and plain html form? Why did the framework developers create form helpers? Just because they were idle? Why invent a whole new way of generating form and ask developers to learn new syntaxes when all of it you can do it in plain html? Thanks in advance:) ...