php

When will automatic rollbacks be executed in PHP executing Oracle PL/SQL - OCI8?

I have PHP code that execute a stored procedure 10 times. If one stored procedure call fails, it should continue on, and at the end commit the transaction. It basically looks like this: $connection = getConn(); foreach($row as $i=>$j) { $SQL = "BEGIN MYPROC.EXECUTE(:VAL1, :VAL2); END;"; $statement = OCIParse($connection, $SQL); ...

Magento: How do I put widgets into a layout xml?

I am using Magento Enterprise Edition. It includes a widget for banners, which I want to use inside of my template, rather than from inside of a CMS-run content block. I succeeded in generating the output from inside of a content block: {{widget type="enterprise_banner/widget_banner" display_mode="fixed" rotate="series" banner_ids="4" t...

zen cart language packs

I have one zen cart website in English language i want to make same website in French and Italian Languages, can you please tell me how can i do this? i mean if i install Language Packs for zen cart, this will convert all the site and data inside database in that language or i have to type data again in particular language. please let ...

Help for Web 2.0 PHP application

All, I have a Web 2.0 application written in Zend Framework and MVC. My application is growing bigger and bigger and I need to come up with a Help system for the entire application. I like the Xero's help interface and was wondering if there's an easy way to create this in PHP5 and Zend or if there are any PHP based tools that I can int...

how to query to display column names except an array list

hey guys im looking for to show columns of a table except some. forexample my table name mobile_table has columns like : sony nokia apple LG Sumsung ...and i need to show these columns except Sumsung ,LG $exceptions_arr = "LG,Sumsung" i know how to show column names of a table but not to apply exeption array filter ! $qu...

What is the easiest method to compare large amounts of similar text?

Hi all, somewhat open ended question here as I am mostly looking for opinions. I am grabbing some data from craigslist for apt ads in my area since I am looking to move. My goal is to be able to compare items to see when something is a duplicate so that I don't spend all day looking at the same 3 ads. The problem is that they change t...

Attach image to Facebook event (php sdk, rest or graph api)

Hello, I have been trying for a good few hours now to create an event through the Facebook API with an image. So far I have been able to create events though both the Graph and Rest APIs without images, but have been unable to attach any images. I believe the REST API is the only API which supports attaching images, but the documentati...

Find Number of lines in a folder

Is it possible using PHP to parse through an entire directory to find number of lines of code in all the files in the dir so this value can be output to the screen - using PHP? ...

How to extract a distinct value in simple xml in php

SimpleXMLElement Object ( [@attributes] => Array ( [type] => array ) [time-entry] => Array ( [0] SimpleXMLElement Object ( [date] => 2010-06-17 [description] => MGIN0: internal administration [hours] => 7.5 [id] => 26334957 [person-id] => 4912655 [project-id] => 4437844 [todo-item-id] => SimpleXMLElement Object ( [@a...

How to add "..." to a long sentence?

Possible Duplicates: How to get first x chars from a string, without cutting off the last word? Truncate a multibyte String to n chars Follow is a type of title: $title = "On the way to mexico city"; For display purpose the title can be approximately 10-20 characters long. So the above should be converted to something lik...

Inserting multiple rows with loop

Code: for($i = 1; $i <= $arr['var']; $i++) { if($i == $arr['var']): $insert .= '('.$n_id.', 12)'; else: $insert .= '('.$n_id.', 12),'; endif; } $uz = mysql_query("INSERT INTO `cars` (n_id, auto_id) VALUES '$insert'") or die(mysql_error()); Why it gives me a ...

Calling Destructor within Object Method in PHP

I have an object that can be used, or eaten, or whatnot in PHP. In any case, it ends up gone. I have an abstract protected method called activate(), which is called by a public method useItem(). Is it possible for useItem() to destroy itself after calling activate()? If not, what is the best way of making sure the item is permanently g...

Is there a stackoverflow/reddit/slashdot PHP clone that supports CQRS?

CQRS means Command Query Responsibility Segregation. ...

Minify HTML/PHP

I'm using gzip to compress my html/php files along with js/css/etc. This reduces the payload quite nicely but I also want to 'minify' my markup of both .html and .php pages. Ideally I'd like to control this from a .htaccess file (where I also do the gzipping) rather than the having to include php to each file. I'd like the output to be ...

PHP/MySQL Pagination

Hey, I am new to php and sql, and i have one tiny question about how to realize sql query , that can: Take for example 5 entries from DB, insert them on 1st page (1-5) Than take next 5 entries from same DB and insert them on another page (5-10) and so on :) Thank you ) ...

Done PHP with Codeigniter for 2 years. How about C# with ASP.NET MVC for the next level ?

Any opinions Ideas Reasons Web development is my first choice but id want to go into developing games once i get more knowledge and become better at programming. ...

Printf syntax parser for PHP/Codeigniter?

Using PHP and/or Codeigniter, I want to create some string templates to be store in a database so that later, they can be used to print out a customize statement. For example, I want to store this "hello %s! you are the %d visitor." in my database so that later I can plug in a name and number to print out this message "hello bob! you ar...

php array selection

I have the following code and want to manually select an array: <?php $articleQuery = mysql_query("SELECT * FROM articles WHERE topic = 'IT' "); while($article= mysql_fetch_array($articleQuery )){ $aid = $article['id']; $media = $article['media']; $link = $article['link']; } echo $aid[0]; ?> The problem is that its not...

download database to iphone

The app I'm writing needs to get information from a remote database and then store it in the SQlite database on the iphone for offline use. As of now I'm using a php script to querry the database and then just basically scrapping the html data from the php echo calls. My problem is that now that I'm moving away from test data I'm using...

Using call_user_function to access parent method in PHP

Is there any way, in PHP, to call methods from a parent class using the arbitrary-argument call_user_func_array? Essentially, I want to write a little bit of boilerplate code that, while slightly less optimal, will let me invoke the parent to a method arbitrarily like this: function childFunction($arg1, $arg2, $arg3 = null) { // I d...