php

Making Select and update in one query

Hy is theere a query where i can do both querys in one? This is the first $q = "select c.id as campaignId,c.priceFactor, o.cid,o.bloggerPrice,o.state as state,o.customerPrice,o.id as orderId,o.listPrice,o.basicPrice from campaign c, orders o where c.id={$campaignId} and c.id = o.c...

Retrieving MYSQL Join values from PHP

I have two or more tables which hold values under the same column name. Now when I join these two tables the column names stay the same. When retrieving these values in PHP ($row['name']) I encounter problems since the column 'name' is used twice. Are there any possible means of separating these two columns inside the query? SELECT ...

Fetching single row, single column with PDO

I have a mysql query that targets a single column in a single row "SELECT some_col_name FROM table_name WHERE user=:user" After I execute the statement $stmt->execute(); how do I get this single cell directly placed into a variable with no loops? In other words how to get from $stmt->execute(); to $col_value = 100; I tried the 2...

How do I embedd an audio player in a PHP page?

I am begginer to PHP, MySQL, and JavaScript developement. I have one link by the name 49(doc file),and audio file name 49(mp3file name). I'd like the audio file to play one time when the link to the doc file is clicked. Is this possible? ...

Validating user authentication for all page

Hi all, I am using the HTML page on front end PHP for server side scripting. now the problem i have configuration page which can be loaded by disabling javascript on Mozilla setting. Since i am using cookie to validate on the javascript For avoiding this i need some thing i can call some php script onload without intimating user and v...

simple way to change the key value of an array element

I am reading in a bunch of multi-dimensional arrays, and while digging through them I have noticed that some of the keys are incorrect. For each incorrect key, I simply want to change it to zero: from: $array['bad_value'] to: $array[0] I want to retain the value of the array element, I just want to change what that individual key...

Is it possible to access a MS Access database with PHP on a Linux Web Server?

Ideally it would be brilliant if I could upload an .mdb file to a linux webserver and query it using php. Is this possible? If so how? ...

problem with date()

I am using the date() function to display a timestamp from my databse. $date = date( 'F jS', $news_items['date']); I know the $news_items['date']; as they return in a YYYY-MM-DD 00:00:00 format. But after the function call $date dispays as December 31st for all values. ...

Flex: Refresh a particular tab of a TabNavigator?

I am using a Tab Navigator component in which there are three canvas components. When i click one of the canvas (or tab), a Pie Chart is displayed. Actually what happens is that on-click 1. the canvas sends an HTTPService whose url is set to a php file 2. That php file actually gets information from a database. Based on that informati...

Perl's taint mode in PHP

Just wondering... is there a PHP equivalent to Perl's Taint Mode? I don't think there is, but thought I'd ask. ...

Question about json_encode and two dimensional array

Hello everyone, I have a problem when i use json and array. And i need your help. Here is my code: while($row = mysql_fetch_assoc($result)){ echo json_encode($row); } The result is: {"id":"1","title":"event1","start":"2009-11-10 14:18:15","end":"2009-11-03 14:38:22","allDay":"false","url":null}{"id":"2","title":"event2","start":"20...

Symfony difference between <ModelName>.class.php and <ModelName>Table.class.php

Cuold someone explain me the difference between the Doctrine auto generated files .class.php and Table.class.php? For example in the Jobeet tutorial there's JobeetJob.class.php and JobeetJobTable.class.php (http://svn.jobeet.org/doctrine/trunk/lib/model/doctrine/sfJobeetPlugin/) I don't understand the role of each file and where I have ...

symfony routing problems

Hello, I'm building a site using symfony php framework. I have a link in my page which leads to page X : <a href="/X">test</a> well, the problem is, under my development environment, the link works and the link points to http://localhost/web/frontend%5Fdev.php/X but when Im using the production page (index.php) the link turns out ...

Is it possible to have a PHP script authenticate users with their Linux user info?

I'm currently trying to expand my PHP driven intranet site for my company. It essentially functions as a bunch of miscellaneous reports and utilities that I've thrown together and linked to on the internal webserver. Whenever people keep wanting the same task done, I script it if at all possible and throw it up on the intranet page so pe...

A particular PHP CMS targeted at artists - forgot name

I remember coming across a very minimalistic PHP CMS that targets mainly artists as an easy way to put their portfolio online. It was open source and had an own site. There was a ZIP download, no hosted service as far as I remember. It was used by a number of artists, including well-known ones. The project site and many implemented site...

php/ajax to do list

Hey Does anybody know of any small and simple ajax/php to do lists which I could incorporate into an application I am building? Ideally we need to create to do and give them due dates. thanks ...

Collecting Column Values Into An Array

One of the patterns that I frequently run across when developing is trying to collect a column/attribute value from a collection of objects into an array. For example: $ids = array(); foreach ($documents as $document) { $ids[] = $document->name; } Am I the only one who runs into this? And does PHP have a way to solve this in fewe...

PHP Preg_split_once

Preg_match gives one match. Preg_match_all returns all matches. Preg_split returns all splits. How can I split only the first match? Example: preg_split("~\n~",$string); This is what I want: array(0=>'first piece',1=>'the rest of the string without any further splits') ...

Select item from database based on date range

Hi all, I have a database of events, and I need to be able to show an event occuring 'today'. The events have start and end dates in the format: Y-m-d h:i:s How would I do this? I've tried queries along the lines of: SELECT * FROM tbl_events WHERE start>='2009-11-03 16:00:00' and end<='2009-11-03 16:00:00' To no avail. Any advice...

How to wrap all this up into a PHP class?

$image='xiaofl.jpg'; $img=getimagesize($image); switch ($img[2]) { case 1: $im =imagecreatefromgif($image); break; case 2: $im =imagecreatefromjpeg($image); break; case 3: $im =imagecreatefrompng($image); break; } $word=imagecolorallocate($im,212,0,0); $str=iconv("gbk","utf-8","php100.com"); imagettfte...