php

Mysql Stored procedures

How stored procedures are fast in Mysql . Where it is suitable to use stored procedures (insert,update,select) How can we make stored procedure of a complex query returning 100000 rows and how can we get these records on php form. any example of such stored procedure using select query returning multiple rows ? ...

make a file directory in php & mySQL

I am currently making a file manager system I store all the folders names and files in the database (MySQL)I am trying to add folders in the database and then add sub folders to them,I wanted it to show all the folders to show in there correct position, Here is a eg: Folder1 Folder1-Sub1 Folder1-Sub1-Sub1 Folder1-Sub...

Get data only from html table used preg_match_all in php

Hi everybody, I have a html table like this : <table ... > <tbody ... > <tr ... > <td ...> string... </td> <td ...> string... </td> <td ...> string... </td> <td ...> ...

How to remove %EF%BB%BF in PHP string

I am trying to use MS Bing API $data = file_get_contents("http://api.microsofttranslator.com/V2/Ajax.svc/Speak?appId=APPID&amp;text={$text}&amp;language=ja&amp;format=audio/wav"); $data = stripslashes(trim($data)); The data returned has a ' ' character in the first character of the returned string. It is not a space because I trimed ...

How to obscure the numbers in the textarea field.

Hi, I have using cakephp and I want to obscure all numbers which is more than six digits. something like this $string = "My id number is 77765444 in Sales dept."; becomes $string = "My id number is XXXXXXXX in Sales dept." I appreciate any help. Thanks. ...

PHP Can't find save handler memcache

I'm busting my brains over this issue (it should be straightforward), but can't seem to find a solution so hopefully one of you can help me. I'm trying to store sessions using php's memcache extension. I'm running MAMP and have installed the extension correctly (I think...it shows up when I do phpinfo), am running the daemon and can c...

PHP Refactoring Tool

Is there any PHP refactoring tool that would transform a huge noodle code to a proper function based one? ...

Zend Json encoding and using in javascript

Hello. I am using Zend Framework. My task is to send JSON data from controller to Javascript. I have an simple array: $array = array('a' => 1, 'b' => 2); After i am encoding this array to json format: $jsonData = Zend_Json::encode($array); But I don't know, how I can get this data in Javascript. I send an ajax request with jQuery....

OAuth Signature Mismatch issues in PHP

So I've been trying to use OAuth to connect to Google APIs. I've succeeded so far in getting the Token Secret. But when I try to make a request to one of the data APIs like https://www.google.com/analytics/feeds/data and sign the request - i'm getting some errors. I used the OAuth Playground (http://googlecodesamples.com/oauth_playgroun...

javascript quotes inside quotes, string literal issue

I am trying to display text in a javascript tooltip I keep getting unterminated string literals even though: a) the quotes are being slashed, b) there are no line breaks The text I am trying to display is: "No, we can't. This is going to be terrible." (its a quotation from an individual and I want those quotes to display in the tool...

Zend_Router omitting param-key

Hey guys, I've got a question considering Zend_Controller_Router. I'm using a a modular-structure in my application. The application is built upon Zend-Framework. The normal Routes are like this: /modulename/actionname/ Since I always use an IndexController within my modules, it's not necessary to provide it in the url. Now I am able ...

Multi-tiered Comment Replies: Display and Storage

So I'm trying to create a comment system in which you can reply to comments that are already replies (allowing you to create theoretically infinite threads of replies). I want them to display in chronological order (newest on top), but of course the replies should be directly underneath the original comment. If there are multiple comme...

Validate South Africa Cell Phone Number

Hi! How can I validate a South African cell phone number? The number must start with the country code like +27 and be max 11 digits long - total 12 with the "+" sign. ...

When I inserting AT&T it will add semicolon in code igniter

Hello, Whenever I was inserting AT&T to database it was added as AT semicolon is added extra in code igniter. My code is like this: $this->input->post('carrier_name'); $this->db->insert('cs_carrier',$insert); please suggest. ...

How can I speed up a MySQL product search result?

I am doing a query on an mysql database based on typed data sent from a jquery autocomplete function. It works fine but take several seconds (5-6+) to get the returned suggestions. There are around 200,000 product entries in the database currently which is expected to go to well over a million entries. How can I speed this thing up, as o...

Creation of edge detection based image in PHP

Hi! I'm curious - is it possible to ahieve in PHP: 1) Send image file to server 2) Process image = detect edges and create simple strokes basing on the edges 3) Save file on server / send it to user's browser / whatever Here is some "sample" file ;P (as You can see it wasn't made using any edge detection enabled program, but by hand -...

How to retrieve Object array value?

Hello, So the thing is that i'm new to OOP php and i seems can't find answer to how to retrieve specific value from Object array. So i run my request to the User class and method find_by_sql: $getAct = User::find_by_sql($sql); Response i get is: Array ( [0] => User Object ( [id] => 6 [permissions...

why width and height of image is not able to get in php

i am uploading image to s3 server and by php i am making a copy of that image on server , if i upload an image of 2.3 mb than the width of image is not coming but if i upload less size image like 26kb than it is showing the width of image so it is able to create the copy . here is my code of php : $s3 = new S3(awsAccessKey, awsSecretK...

fetching data on the iphone

Hey i am developing an iPhone app of a existing PhP mySQL website. i want to know, how to pull data from database and display on the phone? after going through several articles , i found out two ways.. 1) create a web service, on server end, which will provide all the data in XML format to the device. 2) export php,mysql data in JSON f...

php: How to get the unicode character from the STRING "U4e9c"?

This doesn't work (just echoes "U4e9c"): echo mb_convert_encoding("U4e9c","UTF-8","auto"); I guess some sort of casting "U4e9c" is needed, but can't figure out how... ...