php

Query optimization : Which SELECT syntax is faster?

Hello, Given 5,000 IDs of records fetch in the database, which query , in your opinion is faster? Loop through 5000 IDs using php and perform a SELECT query for each one, foreach($ids as $id){ // do the query $r = mysql_query("SELECT * FROM TABLE WHERE ID = {$id}"); } Or collect all ids in an array, and use SELECT * FROM TABLE...

Big problem with booking system PHP + SQL

Hello, I am creating now a new booking system, the part of the private rooms was done and I have now the part of the Dorm (sharing room). The system works like that: Insert coming day + leaving day + how many persons in the dorm the system checks in the DB (of MYSQL by the way) if the is free room. now how it checks? in the DB has c...

Send bitmap data from Flex to Php

I want to save a screenshot from my Flex app on the Webserver (LAMP). Here is the Flex code: private function getBitmapData( target : UIComponent ) : BitmapData { var bd : BitmapData = new BitmapData( target.width, target.height ); var m : Matrix = new Matrix(); bd.draw( target, m ); ...

php script that includes class structure doesn't work

Hi everyone, I have a php script running on centos 5.x When i use a code like $db->connect(); php script doesn't work.I use php myscript.php and it does nothing. .. .. .. $db->connect(); echo "Hello world"; when i run above script it does nothing.Nothing means the like this; [root@xxxxxxx update_call_history]# php update_call_histo...

What is the best method for memory cleanup in PHP? (5.2)

Hi, I have two simple questions. What is better/useful for memory cleanup. $var = null; or unset($var); I have one function with one cycle. I am getting (after few minutes) Fatal error: Allowed memory size of 419430400 bytes exhausted I am setting null and unset()-ing every object (at the end of the cycle) but still without any...

PHP variables between files

There is a php file (current.php) with some variables, like: function do() { $var = 'something'; } And one more php file (retrieve.php), which is loaded to current.php with jQuery ajax .load(). The problem is - retrieve.php doesn't see $var. Tryed this (inside retrieve.php, shows nothing): global $var; echo $var; How to fix? ...

GUI for PHP in NetBeans?

Hi there I would kindly like to ask if NetBeans has any sort of GUI builder like the ones they offered for Java programming? Sorry for the noob Questions. If so, how do I install or use them? Thanks. ...

CodeIgniter better script flow for Query

Hi there, I've the following data: promo_id date time reg_cnt notes 2760 2010-06-02 01:30:00 2 - 2760 2010-06-02 05:30:00 2 - 2760 2010-06-03 07:00:00 1 - 2760 2010-06-03 07:30:00 2 - 2760 2010-06-03 08:30:00 3 - 2760 2010-06-04 09:00:00 1280 promo from vendor xxx 2760 ...

PHP string functions

hello.. is there any other way to print 40 dots in php? i have this in my mind but i think this is wrong.. maybe there was a way like this. <?php print(".",40); ?> is it possible to do in that way? without the use of looping..? ...

How to pass a session id to php site running cake?

Hello, I have two websites on one server, with urls http://testintranet/ && http://mvc.testintranet/ until now they'be just running plain php. I have been able to transfer a user between the two sites, and maintain their session using a get header: /?session_id=26c81c54a93e145ba2cc50a43d77c4ca I've had no problem doing this so far, but ...

Perl equivalent of PHP's get_file_contents() ?

The following PHP code does exactly what I want to do. The problem is I need to re-create it in Perl and I've been playing around with the open() and sysopen() Perl functions but can't do it. Does anyone have any help or know of any links that might help? Thanks. $URL = "http://example.com/api.php?arguments=values"; echo file_get_conten...

Installing phpMyAdmin on Cent OS 5.5

Sorry guys, I posted it on here by mistake... I have created it over at server fault: http://serverfault.com/questions/167302/installing-phpmyadmin-on-cent-os-5-5 ...

Prevent specific Connections from beeing dropped by doctrine:build Task

Hello everyone, i've 2 connections in my databases.yml file, one contains the whole i18n Stuff for the project, the other one regular application Data which shall be erased from time to time during development. What i'm looking for is a way to keep the database with my i18n Data untouched during build, while the other one gets's droppe...

Is PHP classes an effective solution for listing content?

Hi there I would like to list my portfolio on our website, and I wrote a class, Client for setting and getting parameters about each client's basics, i.e.: the client's name, website, is it featured, is it published, what items did we do for them, etc. It's fairly primitive, but am I correct in assuming it's better to create an object ...

wordpress and buddypress help

Hello there, I am currently building a site in Wordpress 3.0 and I am using the buddypress plugin. On registration I am asking using to insert the HTML code that JustGiving supplies show they can show the progress of their fundraising. However when trying to show it in the profile of the all the data shows apart from the flash that, th...

Secure chmod privileges?

The standard chmod privileges are "644" for files and "755" for directories, aren't they? In most cases, PHP doesn't need to write to files or directories. So couldn't I take the write privileges from all groups? I could assign "444" to all files and "555" to all directories. Wouldn't that be more secure? Thanks in advance! Note: ch...

How to store an array into mysql?

Is there a way to store an array into mysql field? I'm creating a comment rating system so I want to store the arrays of user ids to prevent multiple votings. I'm going to create new table that holds the comment id and the array of user ids who have voted on this comment. Than I'll join comments table and this table and check whether the...

Software Product Support Website - Issue Tracking

I am hoping to release my first Android application (yay) and am doing some research on a self hosted (i.e. PHP or RoR) simple support based website where customers will be able to login and report/track issues. The critical required feature for me is some mechanism where customers will be able to vote on feature requests... where most ...

Adding child nodes using SimpleXML

Hello all. I have an XML document and want to insert a new node at a specific spot using SimpleXML. The original XML is this: <epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd" > <command> <create> <domain...

how to map complex type to an existent class

i want to map an existent type to wsdl type the wsdl complex type <types> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/service1/"&gt; <xsd:complexType name="RequestDescriptor"> <xsd:all> <xsd:element name="language" type="xsd:string" default="xx"></xsd:element> <x...