php

Zend_Loader_Autoload setup

I'm running Zend on a XP machine, and i had my neat layout working etc when i changed something (i'm still experimenting to find out what broke it) but for the moment, this is my debug issue atm Debug Warning: /BHAA_ZEND/library/Zend/Loader.php line 165 - fopen(./views\helpers/Doctype.php): failed to open stream: No such file or directo...

PHP UTF-16 to ASCII conversion

Consider the following string. Its encoded in UTF-16-LE and saved into a PHP variable. I failed to get either mbstring or iconv to replace the ' with single quote. What would be a good way to sanatize it. String : Carl Sagan's Cosmic Connection ...

CakePHP: Find where field is not null

I need to select all rows where User.site_url is not null. It's simple enough to do this in a regular MySQL query but how is this done in CakePHP? The manual mentions the following: array ("not" => array ( "Post.title" => null ) ) I have tried the following but it's still returning everything $this->User->find('all', arr...

how to get numeric types from mysql using PDO

I'm using PDO and mysql, for some reason when getting values from the DB that are int type, the PDOStatement is returning a string representation of the number and not a value of numeric type, how do I prevent this from happening? I noticed there is a attribute of the PDO class: PDO::ATTR_STRINGIFY_FETCHES that is supposed to take care ...

Selenium RC Tests + Unit Tests using PHPUnit throws a Seg Fault

So I have a set of unit/integration tests and a set of selenium rc tests as part of my suite. When I run them together using PHPUnit I get a Segmentation fault error message at the very end of the run when, during normal operation, it starts to generate log files. The interesting part is, if I run just the unit tests, or just the seleniu...

Can you help me locate PHP session files?

I have a default configuration of xampp (LAMP) on a windows system, I have been googleing and reading stackflow for an hour but I can not find where php session data is saved, I would like to locate a session file and look at it. Some sites say windows usually stores it here C:\windows\tmp\ but I was unable to find it there or anywhere ...

PHP Export MySQL to CSV - Results showing HTML

Hey everyone, I saw a post on this already, but it didn't really provide a solution (that has worked for me at least)... I have a PHP page that does some basic MySQL queries, the results of which are displayed on the page. I'm using some $_GET and $_SESSION variables throughout this process. In the same page, I also allow the user to ...

Serializing a checkbox array

Hi all, long time reader/first time poster here. So I've got a checkbox array that posted just fine to my table when I had an ajax post via: var createListingString="&features=" + arrayCheckBox; Now I'm jquerying EVERYTHING (and loving it), but each time I try to post my array with data: $("#create_listing_1").serialize(), I just ge...

PHP compatible serialization from C/C++

Anyone know of a library that allows data to be serialized in C++ such that it can be deserialized using the default PHP 'unserialize' function? ...

require_once failed to open stream permission denied

I keep getting the error below even after changing the permissions of the folder. I don't know what to do. Not sure why. Any help would be greatly appreciated. I'm working with cent os server and this is a php script. require_once(mysql_connect.php) [function.require-once]: failed to open stream: Permission denied Date/Time: 7-28-2009 2...

PHP/MySQL Structuring a Table/Database for Profile Usage

Hello all, I am looking for some direction on how the most efficient way to structure my database for users on my website. Essentially, I already have a "tblusers" database that includes basic biographical information, such as: tblusers: UsrID, First, Last, DOB, Phone Number, etc. However, one aspect of my website include...

Zend framework with GWT?

I have been experimenting with GWT recently and I really like it and would like to use it. Problem is I don't use Java on the server side, but PHP Zend Framework. Google shows up nothing, so I am asking here - is anyone using the two together, what are the best practices (ProtocolBuffers, gwt rpc...). Is it possible at all with current...

Can you help me understand PHP Classes a little better?

I am kind of a slow learner I guess when it comes to coding, I have been learning PHP for a couple of years and I still don't understand Classes so it's time I put some effort in to at least understanding them a little better. I use functions for everything. People often make comments to me on here that they can't believe I have a soci...

Session VS File VS Memcache for a Cache in PHP?

I have a social network The users table is around 60,000 rows The friends table is around 1 million rows (used to determine who is your friend) I am wanting to do a friend feed, wall, whatever you like to call it, it will show things like user status post (twitter type posts), it will show a few different items but for the start it w...

PHP/MySQL Output Data in TD's

Hi, How would I go about imposing a restriction on the number of HTML table columns when querying the database. For example, I have a MySQL table with the following values: myTable: id color 1 red 2 blue 3 green 4 pink 5 purple And when I run my query, instead of showing all rows in tra...

Consuming JSON with JavaScript and PHP

2 short questions. I would appreciate an answer or a pointer to an answered question on SO (I searched before asking :)). I'd like to consume one of the TRYNT's web services that returns a JSON object (like this one for example). Am I right in deducing that if they don't specify JSONP, there is no way I can consume those services from ...

Apache vs. IIS PHP performance comparison

Does anyone know of any links to realistic performance comparisons of IIS vs. Apache for PHP hosting? I am looking to utilise existing infrastructure for a change of technologies from .NET to a PHP application but I cannot find any information about PHP hosted on varying platforms. There is heaps out there about IIS vs. Apache in genera...

Integrating search on a website where the backend is MYSQL

I have a location search website for a city, we started out with collecting data for all possible categories in the city like Schools, Colleges, Departmental Stores etc and stored their information in a separate table, as each entry had different details apart from their name, address and phone number. We had to integrate search in the...

Can PHP's ob_start be called more then once?

Can PHP's ob_start be called more then once? Sorry if this is a dumb question but I really don't know. My site is really large (file quantity), its a social network and one of the included files uses ob_start PHP's output buffer for something, i'm not ure someone else started my site a long time ago and now it is mine I need to look i...

Run a ffmpeg process in the background

I am wanting to use ffmpeg to convert video to .flv in php. Currently I have this working, but it hangs the browser until the file is uploaded and is finished. I have been looking at the php docs on how to run an exec() process in the background, while updating the process using the returned PID. Here is what I found: //Run linux com...