php

Memcachedb Versus MongoDB Versus CouchDB in terms of file based caching solution?

We need a caching solution that essentially caches data (text files) anywhere from 3 days up to a week based on user preferences and criteria. In this case memory based caching does not make sense to us. We were referred to MemcacheDB however I also thought of some NO SQL solutions. Our current application uses RDMS (MYSQL) and I guess...

Insert Registration Data in MySQL using PHP

I may not be asking this in the best way possible but i will try my hardest. Thank you ahead of time for your help: I am creating an enrollment website which allows an individual OR manager to enroll for medical testing services for professional athletes. I will NOT be using the site as a query DB which anybody can view information stor...

PHP split alternative?

PHP is telling me that split is deprecated, what's the alternative method I should use? ...

Default values for Content Taxonomy fields in Drupal with Hierarchical Select widget

I'm trying to set the default value for a Content Taxonomy field in a hook_form_alter, but can't pin down the necessary format. I've tried this and many variations: foreach (element_children($form) as $child) { // Set $default_value. if ($form[$child]['tids']) { // This, for Content Taxonomy fields, isn't working: $form[$child]['...

How do I keep a count of undefined strings within a loop using PHP?

I'm using a loop to try to generate keyword combinations and also find the ones that have been used the most. The loop finds all the records in the "posts" table where keyword = "chicago". Within this loop, I need to generate strings. Which, would look something like "chicago bulls" "chicago bears" "chicago cubs" etc... How do I tempo...

PHP | SQL syntax error when inserting array

Hi guys, I am having some trouble inserting an array into the sql database. my error is as follows: Unable to add : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '06:45:23,i want to leave a comment)' at line 1 My query var_dump is: string(136) ...

Compiling Gearman extension for PHP on OS-X Snow Leopard with Zend Server Community Edition

I was wondering if anyone else has figured out how to solve this problem. Whether I install the extension via PECL or compile it by hand, I get the same error: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/zend/lib/php_extensions/gearman.so' - dlopen(/usr/local/zend/lib/php_extensions/gearman.so, 9): no suitable...

What are the correct steps to capture data with uploadify?

Does anyone have a demo of using uploadify with additional fields and saving to database? The site's examples don't explain the process in depth and I am not familiar with jquery. I don't know why but I can't get my head around how too integrate the two. I have the demo working and I have my app which uses traditional php/html forms wo...

Can PHP Perform Magic Instantiation?

Despite PHP being a pretty poor language and ad-hoc set of libraries ... of which the mix of functions and objects, random argument orders and generally ill-thought out semantics mean constant WTF moments.... ... I will admit, it is quite fun to program in and is fairly ubiquitous. (waiting for Server-side JavaScript to flesh out though...

Using PHP can I use a JDBC or ODBC connection?

I have a PHP application that I want to switch from MySQL to Cache DB. I was wondering if I could somehow use a JDBC or ODBC connection since Cache doesn't come with a PHP connection? Thanks ...

Wordpress Menu item

I have a main page that has a children item. Now my question is, is it possible to have the Main page link directly to the children item in it? E.g. -Main Page(links to Page 2) ---Page 2 Here is my code: <div id="MainNav"> <ul> <?php wp_list_pages('exclude=3&sort_column=menu_order&title_li=&depth=1'); ?> </ul> </div> <div id="leftCol...

xmlrpc.php?rsd - what its actually meant by referred in link tag

Need definition of this link tag <link rel="EditURI" type="application/rsd+xml" title="RSD" href="xmlrpc.php?rsd"> ...

PHP given a series of arbitrary numbers, how can I choose a logical max value on a line graph?

I am constructing a line graph in PHP. I was setting the max value of the line graph to the max value of my collection of items, but this ended up making the graph less readable you are unable to view the highest line on the graph as it intersects with the top of it. So what I need is basically a formula to take a set of numbers and calc...

What is the best way to update a field for each row in a table?

I have a table called artists. Within it, there is a field for the artist name (artist_name). Then there is a field for SEO friendly artist name, we'll call it search_name. I have over 40,000 artists in this table. So, I'd like to convert all artists names to search friendly. What is the best way to accomplish this? Not looking f...

[php] Firefox refreshes page 1, even after redirection to page 2

Hi! This is a quite weird and annoying problem, which is reproduced with the script below. Say we have two pages: script.php and script.php?second. Page 1 creates some database entries and redirects to page 2. On page 2, the user is presented with an editor for said entries. If page 1 for some reason crashes on the first try, and pri...

How can I interact with CakePHP models, via script/automation?

I have set up the necessary Models and the web interface to view them via CakePHP. I have a script that reads emails from a POP3 box, parses out certain information. I'd like to use the CakePHP models I have to find existing/create new records, based on information that my email script is parsing out, and save them... essentially usi...

How do I use cookies to store users' recent site history(PHP)?

I decided to make a recent view box that allows users to see what links they clicked on before. Whenever they click on a posting, the posting's id gets stored in a cookie and displays it in the recent view box. In my ad.php, I have a definerecentview function that stores the posting's id (so I can call it later when trying to get the po...

Kohana ORM Aliasing and "Trying to get property of non-object"

I have the following tables in the database: teams: id name matches: id team1_id team2_id I've defined the following ORM models in my Kohana v2.3.4 application: class Match_Model extends ORM { protected $belongs_to = array('team1_id' => 'team', 'team2_id' => 'team'); } class Team_Model extends ORM { protected $has_many = ar...

transforming flat php array into multidimensional one based on key value?

I have a flat array that I'm trying to make multidimensional. Basically, I want to find the items that have parents and create a subarray for that parent id. Right now (and this is simplified), it looks like this: Array ( [0] => stdClass Object ( [id] => 1 [parent] => 0 [name ] => Parent1 ) [1] => stdClass Object...

Dealing with big IF statements in PHP

Hi everyone, Is there any good alternative for the plain if statements in PHP? I know about switch, but I'll guess that there's some more refined alternative out there that comes handy when working with really big if statements. Thanks a lot, ...