php

MySQL: Add sequence column based on another field

Hi all, I'm working on some legacy code/database, and need to add a field to the database which will record a sequence number related to that (foreign) id. Example table data (current): ID ACCOUNT some_other_stuff 1 1 ... 2 1 ... 3 1 ... 4 2 ... 5 2 ......

Wordpress: If two or more posts have same date, date is not shown.

Got a weird bug best shown by this page http://www.zoecormier.com/freelance/ Scroll down to the article named 'Testing turnitin' and you will see the article date is not showing. The article above it (named 'Stolen words') is showing the date. These two articles have the same date, but only one is displaying it. Code for the article li...

Looking for an open source CMS with excellent internationalization and localization

Can anyone suggest a CMS able to offer the following features: Free/open source Support for multiple languages (both frontend and backend) Support for translating content (i.e. an article can have 1+ translations) Support for different content types, namely pages, articles (timestamped, with comments) and image (galleries). Support for...

Passing multiple paramater to PHP from Javascript

Hi All i am trying to Use this function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } function CallSomePHP() { xmlhttp=...

WTF. Strong data typing bug in PHP 5.3?

Hi Is it normal to get the error "Default value for parameters with a class type hint can only be NULL" for a method in an interface defined as public function nullify(bool $force=FALSE); ? I need it to be bool, not an object, and FALSE by default. ...

Split text into words problem PHP, complicated problem

Hi, I am trying to split the text into words: $delimiterList = array(" ", ".", "-", ",", ";", "_", ":", "!", "?", "/", "(", ")", "[", "]", "{", "}", "<", ">", "\r", "\n", '"'); $words = mb_split($delimiterList, $string); which works quite fine with strings but I am stuck in some cases where I have to do with numb...

Paypal Integration holding money

I'm building a site that requires paypal integration. The way it works is I have buyers and sellers, the buyer requests the item, and pays for the item, but the seller needs to accept the money first. So the money is held in limbo until the seller accepts it. Once accepted the money isn't transferred until the item has been received. C...

Accessing methods from another CakePHP controller, or better alternative!

I am creating an 'award' system for my website to encourage a community fealing, much in the same way that stack overflow uses badges. The site is built in CakePHP, i have created an Award model, controller etc - currently the methods for calculating whether a user has an award are contained within the Award controller. However, i can'...

php's $_SERVER['REQUEST_URI '] encoding problem ??

When I output $_SERVER['REQUEST_URI']; on: http://localhost/tools/?tool=cs&amp;sub=1 I get: /tools/?tool=cs⊂=1 Is there other solution to get /tools/?tool=cs&sub=1 besides using &amp; instead of & ? ...

How do I know if a form has been modified

I Would like to know if there is anyway I can check if a form has been modified. eg. If one of the inputs has been changed I would like to display a button to submit the changes. ...

How to export 20 000 contacts from MySQL database via PHP for import into an desktop address book?

Hello, I need to write a script to export contact data for printing on stickers for mailing. There could be up to 20 000 records in the database table. The main problem is that the number of records could be so high and the site is hosted on a shared server and exporting the whole 20k records would, presumably, kill the script or stall....

mysqldump and wamp

Update: Finally got this thing working but still not sure what the problem was. I am using a wamp server that I access through a networked folder. The problem that still exists is that to execute the mysqldump I have to access the php file from the actual machine that is being used to host the WAMP server. End of update I am running a...

Zend Form Field Mapping To DB Columns

I have a Zend_Form $form = new My_Form(); $uploadedData = $form->getValues(); Zend_Debug::dump($uploadedData, $form->name,true) and when i dump the form values i get a string array array(11) { ["event"] => string(2) "26" ["firstname"] => string(3) "sdf" ["surname"] => string(0) "" ["gender"] => string(1) "M" ["company"] => ...

How to convert number to a letter in PHP?

How is this function numtoalpha to print out the alphabetic equivalents of values that will be greater than 9 used? Results, something like this: 10 for A, 11 for B, etc.... PHP.net does not even have that function or i did not look in the correct place, but I am sure it said functions. <?php $number = $_REQUEST["number"]; /*Create a ...

PHP - Dynamic images and IE 7

Hello, I have a webapplication where I read images from a sql 2008 database through the 'new' filestream functionality. The thing here is, when you right-click and choose save image, IE gives error 800700de while with Firefox it works fine. The img src is set to a php document which takes a few params to know where to look in the datab...

Make a Copy of Live MySQL database periodically

Hi Friends, I am stuck with a problem. I am working on a backoffice project which needs to access the live database of our website which is very big and complicated. Now when i connect my backoffice with live Mysql database and run my queries, some slow queries are also there which in turn locks the database for that time period and the...

Zend Framework asking for view script despite setNoRender

I've made an API controller with some actions to spit out JSON for my app and I've turned off the layout and view renderer in its init() method so I've got no view scripts for this controller. I'm trying to use my apiController::treeAction elsewhere in the app via an actionHelper to output some JSON inline. I can access the action direc...

Related posts: Get records by tags from different tables

Hi, I'm working on a news site. Like every news site there will be news, columns, videos and photo galleries. I'm planning to keep these different types of records in different tables but relate them with tags. Here is a simple schema: Tables: News, Videos, Galleries, Columns, Tags, Post_to_tags Post_to_tags: - tagid - postid - posttyp...

Passing PHP variables to an included file?

This should work, so I'm really perplexed about why it's not working. I'm checking to see if a user is logged in using a $session class method at the top of each admin page. However, I want to dynamically adjust the header file depending on whether a user is logged in, and on what role level that user has. So I check $session->is_logge...

categories off-set

Hi there, I am about to build an SQL database and i need to get it right instead of making mistakes and fixing them down the line which is why i am here... I will have main categories and sub categories to them, i need to know weather it'd be best to store the sub categories in the same tables as the main but just offset them for exam...