php

Zend Dd Rowset getting parent row

I am wondering about using the abstraction in Zend Db RowSet instead of joins, is it possible for instance I am able to get some info from parent table as in here /** * Get default photo info (path , description) */ public function getDefaultPhotoInfo($userdId){ $select = $this->select($this) ->where('id=?', $userdId...

Replace newline from MySQL TEXT field to parse w/ JSON

Hi, "replace newline" seems to be a question asked here and there like hundred times already. But however, i haven't found any working solution for myself yet. I have a textarea that i use to save data into DB. Then using AJAX I want to get data from the DB in the backend that is in TEXT field and to pass it to frontend using JSON. But ...

$_GET loading content before head tag instead of in specified div.

The problem is that when the content loads it displays before the tag before i added the <!DOCTYPE>, <html> <head></head> in the index.php file NOW $content loads before the Body tag... when it should beloaded in the "contents" div. (1 I'm trying to get file_get_contents to load the links ?=about ?=services etc into to body.tpl in the c...

PHP: Class to parse OGG and .ogv files?

I am looking for a php class that can parse ogg and .ogv files so that I can get some of the metadata out of the files, such as comments, bitrate, length, etc. I have found this: http://opensource.grisambre.net/ogg/ but after testing it, it does not seem to parse and of the files that I test it with. Has anyone had luck with an alterna...

PHP and Javascript Webservice

By using javascript am trying to cal a webservice.That service return response as follows.. <envelope> <date_time> Test', callbackTest Wednesday, March 31, 2010 2:28:55 AM </date_time> </envelope> I am using firefox as browser to execute the application.Thats why after creating the object of XMLHttpRequest try to read as follows _xm...

tons of fpm_children_bury() in php-fpm.log PHP 5.2.13(PHP-FPM 0.5.13) + Nginx 0.7.65

Hi,all My PHP with FastCGI has some unexpected logs, and works slowly. In php-fpm.log, i find tons of NOTICE, as follows, ... Mar 31 15:26:21.964563 [NOTICE] fpm_children_bury(), line 215: child 59658 (pool default) exited with code 0 after 568.697496 seconds from start Mar 31 15:26:21.966770 [NOTICE] fpm_children_make(), line 352: c...

My choice of fieldname for CakePHP's form helper is not working properly, why?

Hi, I'm creating an AJAX form. The problem is when I'm trying to create a input form with formhelper, my input's name attribute is not correctly renedered in the view. Here's my code: $form->input('MainAttribute.'.$i.'.SubAttribute.'.$j.'.score', array('label' => '', 'options' => $scores)); I created it that way because I want SubAttr...

What is the difference between redirect and forward in Zend framework

hello all What is the difference between redirect and forward in Zend framework? when we should use redircet and when should we use forward? ...

How to Allow Youtube Videos Using HTML Purifier

How do I allow youtube videos on my web page using HTML Purifier http://htmlpurifier.org/. Can someone help me on this on their demo I have to check Use experimental features. How do I fix my code to allow youtube videos? ...

Place Query Results into Array then Implode?

Basically I pull an Id from table1, use that id to find a site id in table2, then need to use the site ids in an array, implode, and query table3 for site names. I cannot implode the array correctly first I got an error, then used a while loop. With the while loop the output simply says: Array $mysqli = mysqli_connect("server", "login"...

Does anybody know how to display additional Intellisense in Phalanger?

Hi, I just installed Phalanger on VS 2008. Intellisense is working fine but I miss additional info about my own functions in Intellisense. Is there something like /** /* param value */ Ben ...

how to update a table based on previous entries in mysql

I am having a serious trouble using triggers in mysql. Basically I am trying to update a row on after insert. I am using the existing value in the row and trying to update an other column of same row. Ex: Existing_Name Actual_Name Product_Arc1 Arc1 Product_Arc2 Arc2 Product_Arc3 I am taking the value of Existing_Name and extracting...

Help me with Php session vs Header redirect?

I have the following pages: page1.php <?php if (isset($_GET['link'])) { session_start(); $_session['myvariable'] = 'Hello World'; header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']) . '/page2.php'); exit; } ?> <a href="<?php print $_SERVER['REQUEST_URI'] . '?link=yes';?>">Click Here</a> pag...

Search for contents inside a website

Anybody please give some useful links on this topic.i need to create a content search for my website.. i have tried google but not get useful materials on this topic...please help me ...

PHP MySQL Weird Update Problem

I have a heap based table in MySQL that I am trying to update via PHP, but for some reason, the updates do not seem to be taking place. Here is my test code: <?php $freepoints[] = 1; $freepoints[] = 2; $freepoints[] = 3; foreach ($freepoints as $entrypoint) { $query = "update gates set lane='{$entrypoint}' where traffic > 50 limit 50";...

If statement structure in PHP

I keep getting an error with the following bit of code. It is probably some small thing but I don't see what is wrong. while($row = mysql_fetch_array($result)) { $varp = $row['ustk_retail']; if ($varp<80000) { $o1 = 1; } if (($varp=>80000) 100000)) { $o2 = "1"; } if (($varp=>100000) 120000)) { $o3 = "1"; } if (($varp=>...

What is the equivalent of PHP's $_POST in a Perl CGI script and how can I use it?

I have two Perl files: action.pl and the other is test.pl action.pl has a form: print $cgi->header, <<html; <form action="test.pl" method="post"> html while (my @row = $sth->fetchrow) { print $cgi->header, <<html; ID:<input name="pid" value="@row[0]" readonly="true"/><br/> Name: <input name="pname" value="@row[1]"/><br/> Description : ...

Unit Testing Codeigniter Classes with fooStack - clashes

I'm having 'fun' testing interactions in a CodeIgniter based web app. It seems when running the entire test suite "phpunit AllTests.php" it loads all of the test classes, their targets (Systems under Test) and creates a PHPUnit_Framework_TestSuite instance which presumably iterates over the classes which extend CIUnit_TestCase and runs ...

HTML Purifier Coding Help?

I read the http://htmlpurifier.org/docs/enduser-youtube.html doc, but I still can't figure out where to put the code to allow object, param and embed tags and Use experimental features with my htmlpurifier. Can someone please show me how to do this? ...

Having a problem displaying data from last inserted data

I'm designing a staff rota planner....have three tables Staff (Staff details), Event (Event details), and Job (JobId, JobDate, EventId (fk), StaffId (fk)). I need to display the last inserted job detail with the staff name. I've been at it for couple of hours and getting nowhere. Thanks for the help in advance. My code is the following: ...