php

Updating textfield in doctrine produces an exception

I have a textfield that contains say for example the following text:- "A traditional English dish comprising sausages in Yorkshire pudding batter, usually served with vegetables and gravy." This textfield is in a form that simply updates an item record using it's ID. If I edit part of the textfield and replace "and gravy." with "humous...

Change value in Mysql database via PHP

Hey all, I want to change a value in a table (in a mysql database) via PHP code. I have a row in the table called 'approved' and there are two options it can be set to, "0" (not approved) and "1" (approved). I am creating a script that will change an individual approved from "0" to "1". For example, there is a different value called...

quick php syntax question

$items = (isset($_POST['items'])) ? $_POST['items'] : array(); I don't understand the last snippet of this code "? $_POST['items'] : array();" What does that combination of code do exactly? I use it to take in a bunch of values from html text boxes and store it into a session array. But the problem is, if I attempt to resubmit the da...

Format STR_TO_DATE to a date.

Hi I have been able to extract a VARCHAR to a date using string_to_date, however whatever I try the date always echoes as e.g. 2009-05-25 Here is my code that works: $query = "SELECT u.url_id, url, title, description, STR_TO_DATE( pub_date, '%d-%b-%Y') AS pub_date FROM urls AS u, url_associations AS ua WHERE u.url_id = ua.url_id AN...

Fast Windows PHP editor with SVN and FTP support?

I'm looking for a decent, and fast PHP editor for Windows. Something that runs natively under x64 would be ideal. I've tried aptana studio, but I'm not impressed with all the excessive bloat. The clunky SVN support and lack of native FTP combined with basically a messy IDE is nasty. I currently use Coda from Panic on my mac, and I love...

I have my requirements for a mvc web application, now what?

I’m working on a project and have developed the high level user requirements for what the system must do. This project is a php mvc web application built on the CodeIgniter framework. Now I’m trying to take those requirements and break them down further into controllers/actions. What is the best way to do this? I was thinking of cr...

Is there anyway to upgrade PHP4 mysql client?

I get the following error: Client does not support authentication protocol requested by server; consider upgrading MySQL client I know I can solve it with: SET PASSWORD FOR user@localhost = OLD_PASSWORD('password'); But I want to know if there is another way to do it by using a different PHP mysql extension or something? ...

Call an Object inside of a function

So I'm not to OOP in PHP. Here is my issue I have a object that I can call a function from and it provides back an arrary. So here is the code. $obj = new OBJ(); function go($url){ $array = $obj->grabArray($url); echo $array['hits']; } go('http://www.mysite.com/hello'); This gives me the error Fatal error: Call to a member...

What should resources be in an ACL? Models of objects or the instances of the objects?

Please help me implement access control lists for my PHP web application. I'm using Zend_ACL specifically. I want fine grained, application wide control over what specific entity (be it a user or group) has access to what resource. I would like to be able to grant access to a particular resource instance, but also to all resources of th...

PHP/Rails/Django/ASP websites should have been written in C++?

I was looking at a SO member's open source project. It was a web framework written in C++. Now you are all probably ready to respond about how C++ is a horrible language to do websites in, and that in websites, the bottleneck is in the database. But... I read this post: http://art-blog.no-ip.info/cppcms/blog/post/42 and in there he m...

PHP hangs waiting for exec to return results from wget+mysql command

Related: see here I've got this command: exec("(wget -O http://domain/file.zip && mysql -u user -ppassword database -e \"UPDATE \\`table\\` SET \\`status\\` = 'live' WHERE \\`id\\` = '1234'\") & echo \$!"); The above command works fine, however PHP waits for the video to finish downloading before going on to the next download. The f...

how do i join 7 tables where a column (which exists in all tables) equals the same content in all tables?

i have seen how to inner join 2 tables where a column is equal to the content in another column. but how do i do this with 7 tables?' thanks everyone, I figured it out lol after a long time. this seems to work SELECT * FROM tbl_school INNER JOIN tbl_apprequirments ON (tbl_school.schoolname = tbl_apprequirments.schoolname) INNER J...

Faking Late Static Binding before php 5.3

I need an inherited static function "call" to call another static function "inner" that has been overridden. I could do this with late static binding, but my host does not have php5.3 yet and so I need to work around it. class ClassA{ static function call() { return self::inner(); } static function inner(){ r...

Returning multiple rows per row (in Zend Framework)

I have a MySQL database containing these tables: sessions -------- sessionid (INT) [courseid (INT)] [locationid (INT)] [comment (TEXT)] dates ----- dateid (INT) sessionid (INT) date (DATE) courses ------- ... locations --------- ... Each session has a unique sessionid, and each date has a unique dateid. But dates don't necessarily...

Calendar, offset overlapping events

Greetings everyone! I am trying to write a calendar in PHP. In week view, I want my events to be listed like iCal, where simultaneous events reduces their width to half size. I have an extremely hard time figuring this one out though, so I hope you can help me. What I want is that if one event is overlapping another, it should set "[sp...

Find out how many users are online in PHP?

Every visit to my website updates a user's individual hit counter and updates a column for time() based on their ip address and id stored in a cookie. So when coming to output the data, what's a more efficient way of my following code with less database calls, as it's essentially a copy of itself: <? $last1Min = time()-60; $last5Mins = ...

Making SVG and MathML work for PHP on Apache

I'm a little confused as to how to configure my Apache server. I'm using Apache 2.2.11 Take these 2 pages as a good example: HTML XHTML They're both one and the same syntax, but the extension is different. The first file has HTML as an extension, the second has XHTML as an extension. The server in the background has the following set...

What do sites like Google Docs and Zoho Writer use to generate MS Office documents

I realise this may just be speculation, but I'd appreciate comments from anyone who has some insight into this. Something like MS Word COM add-in, or an OO bridge, or a custom implementation. The reason I want to know is that I want to provide basic online document editing (really basic, basically just rich text at this point) for a ph...

How to return javascript variable to Ajax?

Does anyone know how can I return the javascript variable to ajax instead of string value while I using ajax to call the php. Please see below example for more details: Ajax: //Ajax Param var paramList = "Action=make_process"; ajaxRequest = $.ajax({ url: "admin.php", type: 'POST', data: paramList, error: fu...

splitting string based on values in an array

I've got a group of strings which I need to chunk into an array. The string needs to be split on either '/', ',', ' with ', or '&'. Unfortunately it is possible for a string to contain two of the strings which needs to be split on, so I can't use split or explode. For example a string could say 'first past/ going beyond & then turn', ...