php

How can I use a php array in a mysql search query?

I was going to use the scuttle solution on: http://www.pui.ch/phred/archives/2005/04/tags-database-schemas.html for handling searches on my website. I was wondering how I could take the search input from a user and turn it into a single query. For instance, let's say a user inputted 'blue dogs' in their search query... How could I dyna...

how to get a text box with the value selected in select box

hi This is my view page here i have a select box <tr> <td>Chidren</td> <td>:</td> <td><select style="font-family: verdana; min-width: 52px;" id="ddlChildren" name="ddlChildren" class="required" onChange="return Check_Adult('dd1Age')" > <option value="">children</option> <option value=...

What's wrong with this SQL query?

I have two tables: photographs, and photograph_tags. Photograph_tags contains a column called photograph_id (id in photographs). You can have many tags for one photograph. I have a photograph row related to three tags: boy, stream, and water. However, running the following query returns 0 rows SELECT p.* FROM photographs p, photograph...

Upload picture from iPhone in Web App

I have built a web-app for iphone using iUi framework. As you may already know, mobile safari doesn't support file upload form element. My application allows school administrators to do classroom walk-throughs, marking off what they see in the classroom (in web form survey). I would like to add the ability for them to upload a picture ta...

How do I add text to curved image?

$config['source_image'] = '/path/to/image/mypic.jpg'; $config['wm_text'] = 'Copyright 2006 - John Doe'; $config['wm_type'] = 'text'; $config['wm_font_path'] = './system/fonts/texb.ttf'; $config['wm_font_size'] = '16'; $config['wm_font_color'] = 'ffffff'; $config['wm_vrt_alignment'] = 'bottom'; $config['wm_hor_alignment'] = 'center'; $con...

Easy way to convert a Doctrine_Collection of Model classes to an array of simple objects?

To clearly separate the Controller and View layers, I do not longer want to pass full objects to my views. Instead I want to pass only arrays and objects that contain the data but do not have any methods. Otherwise a view script would be able to delete Doctrine records or traverse in the object tree to data that was not intended for the ...

Initiating background process for running php file as background from another php page

I want initiate one php page as background process from another php page. ...

How do you debug php web page that has pretty urls in zend studio?

I've read many tutorials on how to debug php web page like this one, all are very good except that I don't see any of them take into account .htaccess. So these solutions won't work for web pages that have pretty urls. Has anyone figured it out ? ...

PHP: closing db connections on included and ajaxed files

When I call to a page through ajax should I close the connection at the end ? The ajaxed file has a connection string for itself ofcourse, so I wonder if this connection stays open when the call is over, and if it's a disaster to not close these connections... Thanks in advance to all ...

HOw Do I update from table-2 to table-1

HI what is the wrong in this code?? i have set it 24 hours to update the value in the table.but the problem is if $row is empty then it inserts value from table-2 but after 24 hours it wont update the value. what I want is it must delete the existing value and insert new one(random value) or it must update the same $row with new value w...

PHP Function to split a combined CSS attribute/value to several attributes

Basically, I want this: h2 { font: bold 36px/2em "Times New Roman" } To this: h2 { font-size: 36px; font-weight: bold; line-height: 2em; font-family: "Times New Roman" } And other variations, of course. Does anyone know of a function that does this so I don't have to code it myself? :) ...

xdebug or zend debugger?

It seems to me the same function set, but I'm not sure. What is the difference in functionality? ...

How to execute a function until it succeeds?

I am writing a function to send a mail to specific user? What I am trying to do is, if error occurs I want to keep on sending the mail until the mail is sent. function sendmail() { $name = mysql_escape_string($name); $email = mysql_escape_string($email); $phone = mysql_escape_string($phone); $conten...

string function workout in php

I have the string like this, $inp1 = "3 doses at 0[0,0], 1-2 and 6 Month[6,1] [3,2])"; in this internally, going to take the values of square bracket. How can i take this values in the square bracket? any function is there to return the string like this [0,0] [6,1] [3,2] Thanks in advance for help. ...

my sql insert query not working

I am inserting userId.It is displaying correct but inserting 0 in spite of actual userId. mycode- If(! empty($userIDToCheck) || $userIDToCheck != '' ) { echo $userIDToCheck; $sql = "INSERT INTO `pnpdb`.`ruser` (`userid`) VALUES ('$userIDToCheck');"; mysql_query($sql)or die(mysql_error()); echo "Done"; } Output : pi203713 Done...

How can I use an array within a SQL query

So I'm trying to take a search string (could be any number of words) and turn each value into a list to use in the following IN statement) in addition, I need a count of all these values to use with my having count filter $search_array = explode(" ",$this->search_string); $tag_count = count($search_array); $db = Connect::connect(); $qu...

NAMESPACE_SEPARATOR constant

Hello, Having namespaces in PHP is great. Having '\' as namespace separator is a little bit ... awkward (but if there is someone who thinks that is cool & sexy, I am adding tag "rant" to this post. ;) . So, here goes the question: Are you using in your code NAMESPACE_SEPARATOR constant? As in code below: <?php if (!\defined('NAME...

PHP code - what does this part of code mean?

what does the assignment in this loop do? I don't get the array notation in it :S foreach($fieldvalues as $fieldvalue){ $insertvalues[] = $fieldvalue; } ...

change file directory with php

Hi, How do I change the file location? Now file is in "news" directory, how put file in "old_news"? ...

how can i request a variable in my home.ctp of my cakePHP application?

I created a page using the MVC structure called 'sections' ( view is located in the app/views/sections folder, model in the model folder and the controller in the controller folder) when i request the variable $test, it works fine without any errors.. When i want to request this variable in my home.ctp, it provides me with an error, sa...