php

beginner at mysql need some help please

Hi everyone, I have just started to learn PHP/Mysql and up until now have only been doing some pretty basic querys but am now stumped on how to do something. Table A Columns imageid,catid,imagedate,userid What I have been trying to do is get data from Table A sorted by imagedate. I would only like to return 1 result (imageid,userid) f...

PHP Send mail error

Please help me I am New in PHP and since last 5 Hours i am try to semd mail and now really tired. Thanks. Here is my code. I am using Gmail account. include("class.phpmailer.php"); //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded $mail = new PHPMailer(); $bod...

File from SOAP, how to save?

I am working with a client on getting a gzip from their webservice. I am able to get a response with my following call: $response = $client->call('branchzipdata', $param); $filename = "test.gzip"; if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } if (fwrite($handle, $response) === FALSE) { ...

Can't get memcache to return value

Hi, I've taken a bit of a memcache script that i've used previously without issue, but on the new page, I don't get any response. the memcache is in a function which is included from another page. what I do is put the md5 hash the mysql query and store that as the key for the memcached data. if the key isn't in memcache, then I go, cr...

Is this sound Objected Oriented Design for an e-Commerce site?

I'm pretty new to OOP/OOD, and I realize I have a lot to learn, so I'd like to ask the SO community for their input. Basically, I'm using CakePHP's MVC framework, and the online store I'm building is just using 2 models, Category and Product, described by the following CREATE statements: CREATE TABLE `categories` ( `id` int(11) uns...

Make array value variable (PHP)

Hi, Say I want to echo an array but I want to make the value in the array I echo variable, how would I do this? Below is kind of an explanation of what I won't to do but it isn't the correct syntax. $number = 0; echo myArray[$number]; ...

Is the Validate PEAR package ready for production?

There appears to be a Validate package in Pear that I'm interested in useing in production. Our site has about 20M uniques across 10 languages, so as part of due diligence, thought I'd asked around here. Does anyone have any experience with this PEAR package? Is it ready for production? Here's the Validate package in question: http:/...

How common is PEAR in the real world?

I have looked at a good deal of other peoples source code and other open source PHP software, but it seems to me that almost nobody actually uses PEAR. How common is PEAR usage out in real world usage? I was thinking that maybe the current feeling on frameworks may be affecting its popularity. ...

PHP arrow operator closing tags

I am writing a php app on the websever I set up at my house. It is a fedora10 machine, running php5 and mysql. I have code like this: <?php echo $var->function(); ?> But for some reason the -> is closing the php tag, so the output has 'function(); ?' added to it...is there something I need to change in my php or webserver configurat...

Strange http gzip issue

Here's a strange one: I've got nginx reverse proxying requests to apache 2 with mod_php. A user (using firefox 3.1b3) reported that recently, he's started getting sporadic "What should firefox do with this file?" popups during normal navigation. We haven't had any other reports of this issue, and haven't been able to reproduce it ours...

Which billing provider can I use for my SAAS applications?

Hi I'm working on a Software-as-a-service (SAAS) application that allows companies to manage supplier information. What are the providers / vendors that can offer Billing services, including managing invoices, subscription, renewal and reminder for payment dues? I find that building this from scratch will take a lot of time. In addi...

How can I search/summarize my PHP results?

Hi there, I've retrieved a series of objects from the Twitter API, and I want to summarize them. I'm most familiar with analyzing results from a SQL query, but given a series of objects like this: array(9) { ["results"]=> array(1) { [0]=> array(9) { ["text"]=> string(14) "4.2 #runlogger" ["to_user_id"]=> NULL ...

Trying to find an open source mailing list system to integrate into my Zend Framework application

I'm looking for a simple, open source mailing list application (or library) that I can add to my Zend Framework application. I can't seem to find any that are decent, and once I have, not quite sure how I will integrate it (due to MVC). Has anyone done this? ...

How to do text DIFF using PHP?

What is the best way to do this for PHP? Is there any PHP function that can do this, considering the column content could be very large? If PHP function is not available, what shell utility can I call? thanks ...

how to extract a portion of a string in php

I am using preg_replace() for some string replacement. $str = "<aa>Let's find the stuff qwe in between <id>12345</id> these two previous brackets</h>"; $do = preg_match("/qwe(.*)12345/", $str, $matches); which is working just fine and gives the following result $match[0]=qwe in between 12345 $match[1]=in between but I am using s...

PHP Redirect Pause

How do I pause a page for a certain amount of seconds before redirecting the user to another HTML/PHP page using PHP? ...

send a file to client

I want to write a text file in the server through Php, and have the client to download that file. How would i do that? Essentially the client should be able to download the file from the server. ...

Good alternative to Eregi() in PHP

I often find myself doing quick checks like this: if (! eregi('.php',$fileName)) $filename.='.php'; But sadly eregi() is going to be deprecated in PHP 6, which means all of my code that uses it will be rendered useless :(. Is there another function that behaves exactly the same way as eregi()? I don't know anything about reg ex...

Easiest Form validation library for PHP?

I need a simple php library which can be used to easily pass rules and field names to, and then validation could be easily performed. There should also be an easy way to retrieve the errors. Any suggestions? ...

PHP write to file

Hi, below is some code I am using to "translate" a map array into SQL code so I can easily update my database when I have updated my game map. As you can see it prints out the SQL code onto the screen so I can copy and paste it. As my maps will get bigger this will become inefficient as it will crash the browser due to mass output, so i...