php5

Format date in MySQL

All, I have a MYSQL table that has a column "DT_Created" defined with timestamp datatype. I would like to write a select query to retrieve the timestamp in the following fashion: Sat, MM/DD/YYYY HH:MM:SS AM CST Lengthy Explanation: Day, Month/Date/4 Digit Year Hours:Minutes:Seconds AM or PM TimeZone How can i do that? Thanks ...

MySQL remove space before order by clause

Hi all. I have a table full of "title" that I want to order by title. Problem is a lot of them have a empty space before the title. I am thinking of writting a php script to fix it all (super easy) but I was curious how could I do: SELECT * FROM products ORDER BY title But at the same time trimming the title so it doesnt order on the ...

PHP Sessions to handle Multiple Servers

All, I have a PHP5 web application written with Zend Framework and MVC. This application is installed on 2 servers with the same setup. Server X has php5/MySql/Apache and Server Y also have the same. We don't have a common DB server between both the servers. My application works when accessed individually via https on Server X and Serv...

Wordpress get category main name

So if I'm on a subcategory page...how can I get the name of the main category? So let's say I'm on site.com /my-category/my-subcategory/ so how can I get "my-category" ? I don't want to parse the url :) cuz' I think wordpress has a built in function or smth. Best Regards, ...

cassandra: Storing value?

Hi everybody, I wanted to make a tryout this weekend with Cassandra + PHP in my testing environment. So after a few hours of headache trying to install it, I finally succeeded and got it running. However, I've tried out the different PHP wrappers for cassandra, and I have totally failed to connect with anyone. SimpleCassie which I want...

To models using the same table but with conditions in CakePHP

I have two models that I would like to save in the same table. For instance I have a status model and a payschedule model both should be saved in the statuses table. But at retrieving the status model should return only the records with payment = 'no' and the payschedule only records with payment = 'yes'. I will have a before save in e...

Setting up Postgresql to work with my local dev

I have Snow Leopard and am using the default apache. I installed postgresql via macports. So now I can do a psql from a terminal (I tried but failed to do a install of php5 through macports but there was an error) I have enabled php5 and restarted the apache so now I have php. But for the life of me I cannot figure out to hook up postgr...

display data in tree structure using php

I want to display data in tree strucure using php. The data should be read from xml file. The root direcory information will be in 1st file(ex level0.xml).the sub directories of root will be in level1.xml file and so on.I need to get the values from these file and display in tree structure. When i click the directory it should read the n...

loop through queries

//display faction userlevel: $level_boss = $req_faction_info['f_boss']; $level_uboss = $req_faction_info['f_uboss']; $level_rhm = $req_faction_info['f_rhm']; $level_lhm = $req_faction_info['f_lhm']; $level_r1 = $req_faction_info['f_r1']; $level_r2 = $req_faction_info['f_r2']; if($level_boss == $username){ $u_level = 'Boss'; } elsei...

PHP, IDE, MySQL, Curl API and apache installation

Is any installer which can configure PHP, IDE, MySQL,Curl API and Apache. my goal is to use Curl API using PHP. I am lots of trouble with manual installing. ...

WAMP Curl installation

I have uncomment the following from the php.ini file ;extension=php_bz2.dll extension=php_curl.dll ;extension=php_dba.dll Also ,I have copied the php_curl.dll to windows\system32 and restart the apache server. I am testing the follwoing script <?php $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'http://example.c...

Eclipse for PHP

I have installed WAMP and enable some extension. After that i have installed eclipse for php. now my question how can i let eclipse now that i should use apache installation and the version of php which came with WAMP. I will be developing web apps on windows. ...

php eclipse debuging

I am runing a php script using eclipse. when a set breakpoint and run the script it throws me this error. form the error it is apparent that i have change something the php.ini file. but i dont know what i have to change to make either zend or xdebug. even i dont know what the differnce b/w them. following the error The session could ...

Rendering layout parts in Zend Framework

My app is supposed to work like this. First, the default Action of the Default controller (according to URL) does it's job. For the purpose of this question lets name it MyController and indexAction. Then it forwards ($this->_forward) to my LayoutController menuAction which renders navigation part (menu from database) and forwards to fo...

Setting default selected option for Zend_Form_Element_Select

I have a Zend_Form with Zend_Form_Select element. I populate it from array (code inside the *Application_Form_MyForm extends Zend_Form* class): $options = array('first option', 'second option', 'third option'); $this->getElement('mySelect')->addMultiOptions($options); How can I choose which value is gonna be selected automatically, as...

Advantage of passing by reference opposed to using global?

Hi guys im looking at the MVC pattern, and I can see in one example on phppatterns they're passing the model by reference - any benefit of doing this over a global var? Am I missing something obvious? class MyView extends View { var $model; function __construct(&$model){ $this->model =& $model; } function productTable($...

dollar sign in associative array Index

I am using Google Analytics API in PHP. I am fetching JSON data which I am converting into Associative Array by using Json_decode however when try to access attribute dxp$dimension, it gives error since it evals $dimension as a separate variable. How do I evaluate whole thing as an Index for fetching data? Thanks ...

PHP starter -sample kit

I am looking for a starter kit- samples for learn web development. my goal is create a ecommerce web site. ...

Interspire Special Offers

Hi I am working on Interspire I have made whole of the site but i have a problem . How can i add Special Offers link in my website, is there any link which i can use please tell me Thnaks ...

A windows php stand-alone compiler that works with the Zend GData library and PHP 5.2x ?

Hi all, I am hoping there exists a: " php stand-alone compiler that works with the Zend GData library and PHP 5.2x." For using with the following php GCAL sync software for a software called todolist. Any suggestions? ...