php

MySQL Query puzzle

I have a table with two fields (id and word). Can anyone enlighten me as to why: $query0 = "SELECT * FROM words WHERE id IN ($treated_words) "; is a valid query. But: $query0 = "SELECT * FROM words ORDER BY id ASC WHERE id IN ($treated_words) "; is not. Many thanks ...

php, jquery, flash & .click function in Firefox 3 - stumper

Hi all, I have a page that is using PHP to build itself and then uses Jquery to embed some SWF's into the page with different Flashvars based off the DB connection in the PHP section of code. I then have a jQuery .click(function(){ that fires a simple alert at the moment to test for functionality - this works as expected in Safari, but ...

background image not displaying

can someone please tell me why the background image is not displaying in my php code. #wrap-iframe{ background-image: url(bg_01.gif); background-repeat: no-repeat; border:0 none; min-width:760px; min-height: 700px; } this is the CSS i have. the div box is displayed flawlessly. the image url is correct. if i inlcu...

Paginator doens't store search parameters

i'm using jpinedo.webcindario.com/scripts/paginator at my search script, but when i click on the page 2 the parameters from the first search are lost (i get my own message for "you need to type at least 2 characters") how can i make it work? this is my search.php: $q = mysql_real_escape_string($_POST['q']); $option = mysql_real_escape_...

how to convert Doctrine object into json

I am using Doctrine 1.2, how could I get the query object into json / array format? $user = Doctrine_Query::create() ->select('u.id, u.username, u.firstname, u.lastname') ->from('User u') ->orderby('u.id') ->execute(); ...

Retrieve Database Value Without Page Load AJAX/PHP/Facebook Style

Hi all, I am wondering if anyone could show, or explain with examples, how facebook checks its database for new messages? It seems to do it periodically, without loading the page. What would be the best way to achieve this in a PHP/MySQL/Jquery script? Any help is always appreciated! Cheers, Lea ...

Arguments with regex

I would like to know how to split this string: command arg1 arg2 arg3 In this array: [arg1,arg2,arg3] BUT if the user types: command "arg1 still arg1" arg2 The array will be: [arg1 still arg1, arg2] Using PHP ...

Zend Framework Controller Mappings

I have my directory structure set up as follows: Application Root |-application | |--configs | |--controllers | | |--helpers | | | |--layouts | | |--scripts | | | |--models | |--views | |--scripts | |--index | |--test | |--data | |--session | |--public |--index.php |--.htaccess In my controllers directory...

help with regular expression

is it possible to get a regular expression that do: find first occurence of some word in a string return a substring of a nr of letters before and after the occurence but if it encounters a . (dot) before the nr of letters before and after occurence, it will just return the sub string before/after the dot. return whole words example:...

How to update a web page without reloading the web page using AJAX?

I'm trying to update info that a users entered in to a mysql database using php without reloading the web page how can I do this an example or tutorials will be nice. If there is a tutorial on how to do this can you please share with me the link or links to the tutorial(s). ...

PHP: how to iterate through an array, and resume where you left off?

Here's my array: $array = array(1,2,3,4,5,6,7,8,9,10); I want to iterate through the array 5 times, do something else, then resume iteration where I left off. foreach ($array as $value) { //do something until key 5 } //do something else now //resume... foreach ($array as $value) { //key should start at 6 } How can I do th...

how to collaborate between javascript and php

i am calling a javascript for image gallery and php on a single page. let me show you some code to make things clear: PHP echo "<form method = post action = 'user_submit.php'>"; // get possible answers using question ID $query = "SELECT aid, atitle FROM answers WHERE qid = '$qid' ORDER BY aid ASC"; $result = mysql_query($query) or di...

Is there a way to bind variables? PHP 5

Using PHP 5 I would like to know if it is possible for a variable to dynamically reference the value of multiple variables? For example <?php $var = "hello"; $var2 = " earth"; $var3 = $var.$var2 ; echo $var3; // hello earth Now if I change either $var or $var2 I would like $var3 to be updated too. $var2 =" w...

redundant implementation in CI controller

Hi ... I wanna ask you best practices about blog front page. I wanna build blog application using CodeIgniter framework. I have 2 type of page (front page, and admin page) Supposed I have several controller in my front page (home, post, page, and link). By default I have include viewer of for all of these controller: header.php, footer...

Recommendations for webapp stucture PHP Jquery mySQL

Im been playing with PHP for a while, whilst not actually doing it for a crust. I have now stumbled upon jquery and have found it really easy to get what I want out of it. Combining all this together I have strung together a webapp but with no formal training I could possibly be going about it all wrong as far as structure goes. What ...

Can I use APC AND memcached on the same server ?

I am using memcache for cacheing objects, but would like to add in addition an opcode accelerator like APC. Since they both involve cacheing, I am not sure if they will be "stepping on each others toes", i.e. I am not sure if memcache is already an OP code accelerator. Can someone clarify? I would like to use them both - bit for differ...

Image Classification - Detecting Floor Plans

I am working on a real estate website and i would like to write a program that can figure out(classify) if an image is a floor plan or a company logo. Since i am writing in php i will prefer a php solution but any c++ or opencv solution will be fine as well. Floor Plan Sample: Logo Sample: ...

How to check a php response for string with jQuery

I have an ajax query sending to a php script and putting the response into a div. The code is as follows: $.ajax({ type: "POST", url: "core/process.php", data: data, success: function(response){ $("#form").fadeOut('slow'); alert("DO NOT LEAVE THIS PAGE UNTIL COMPLETE"); $("#response").html("DO NOT LEAVE THIS PAGE UNTIL COMPLETE...

Connecting to remote MySQL server using PHP

Hi All I am attempting to connect to a remote MySQL server from my local machine virtualhost using the following code: $conn = mysql_connect("$dbhost", "$dbuser", "$dbpass") or die(mysql_error()); mysql_select_db($dbname, $conn) or die(mysql_error()); My problem is that I am unable to connect locally, receiving the error: ...

PHP Chart Library Solution

Hello. Good day. I am a newbie to PHP framework, and I know a little about CI. Recently, i plan to start my new practice project with Kohana. I am looking for a good PHP Chart Solution. Requirement: Free chart library is better; Integrated with Kohana well. Could you give me suggestion about it. Thank you for your reply here. ...