php

Retrieving data from simplexml_load_file

Working with the simplexml_load_file() function, I get a side effect. To understand what I mean, see this code: $result = simplexml_load_file($xml_link); $arr = array(); foreach ($result->element as $elem) { $arr[] = $elem->number[0]; } print_r($arr); Output: Array ( [0] => SimpleXMLElement Object ( [0] => 33041187...

Out-of-the-box Eclipse PDT (PHP Development Tool) not capable of debugging PHP, why?

I just finished reinstalling the "All-In-One Eclipse PDT" from zend.com. It's unable to debug even the simplest "Hello World" PHP script. How can such a major open-source app be released in such a bad shape? What am I doing wrong? This is the result of doing a "Debug As... 2. PHP Script": Problem signature: Problem Event Name: APP...

output query in strict table formate in code-igniter

Dear all, my code is below.it show the output in table format having no problems. But when the particular tr gets long output from database then the table break. Now how can i fixed the tr width strictly?let say i want each td cannot be more than 100px. How can i do it? Note: Here table means html table,not the database table. ...

Replace c:\ with file:\\\c| using PHP

Hello, I have the local file path as c:\new folder\pdf\today\k.pdf I want to replace the c:\ with file:\\c| I tried str_replace('','',) but I get error due to the slash, no stripslash will not work. Thanks Jean ...

Versioning code in two separate projects concurently with subverison

I have a need to create a library of Object Oriented PHP code that will see much reuse and aspires to be highly flexible and modular. Because of its independent nature I would like it to exist as its own SVN project. I would like to be able to create a new web project, save it in SVN as its own separate project, and include within it t...

php- javascript

i got a sales web site each time i press "sales" button it it will open a new frame. there is a possibility for more then one frame at the same time. my problem is i want to close the frame after i click enter and home page to be updated provided all the other pending sales frames are remain open.... i tried to do so with window concep...

I want to add an image from a local directory to a php page

Hello, I have a page on my http://localhost/user/profile.php. I want the users to add a link of their photo from the desktop. I donot want them to upload. and display the same. The image is not displayed. What exactly am I doing wrong here? Thanks Jean ...

PHP Web Service vs mySQL Connector on Windows Application

I have a Windows Application in C#. This application interacts with a remote mySQL database. Should I create a PHP web service to do these (insert/add/delete/update) or use mySQL connector for c#? I'm not sure which way is better. Thanks! ...

How can I put rows of MySQL data under the appropriate titles using PHP?

I have the following MySQL table structure: num field company phone website 1 Gas abcd 123456789 abcd.com 2 Water efgh 987654321 efgh.com 3 Water ijkl 321654987 ijkl.com 4 Heat mnop 987654321 mnop.com 5 Gas qrst 123789654 qrst.com ... Is it possible with PHP (maybe using some mixture of GROUP_BY and ...

Automatically pulling on remote server with Git push?

Here's what I'm trying to do: I have a GitHub repository, a portion of which I'd like to make web viewable. Right now I've cloned the repository on my own server and it works well, but in order to keep it up to date, I have to manually login and pull the latest changes. I'm not sure if this is the best idea (or the best approach), but ...

Hooks...exactly what they are

I have seen hooks in Kohana PHP framework, and they work as some sort of a callback function triggered by a certain event (Kohana's events that is, some sort of method overloading). I have seen hooks in Wordpress, and I don't know what they are or how to use them (just saw them yesterday). I'm looking for events in "non-frameworked" ph...

help solve a problem in parsing dmoz rdf files using php script

Hi, I used the php script in http://sourceforge.net/projects/dmoz2mysql/files/ to download , extract , clean , parse and insert dmoz data into mysql table. i encounter no problem while processing structure.rdf . But while parsing content.rdf , there is an abrupt pause after inserting 3200000 rows.. and nothing happens after that - ...

Using php variable inside a query

Hi, i am using a query inside php as $query = 'SELECT * from #__chronoforms_UploadAuthor where text_6 like "%'.$_GET['title'].'%" and text_7 like "%'.$_GET['author'].'%" limit 0,1'; where i am trying to insert a php variable instead of 1 in the limit.. $query = 'SELECT * from #__chronoforms_UploadAuthor where text_6 like "%'.$...

Problem in migrating to LAMP from XAMPP.. Memory limit error

I was using XAMPP for my local machine but as I wanted to run applications like mysql work bench and some test frameworks I decided to switch to LAMP self install. I'm using ubuntu and followed the instructions at: https://help.ubuntu.com/community/ApacheMySQLPHP But the problem is LAMP is consuming too much of my memory (RAM) I've allo...

MySQL return 0 if nothing found

$query = "SELECT field1, field2 FROM table WHERE id IN (1, 2, 3, 4, 5)" $result = mysql_query($query); $array = mysql_fetch_assoc($result); If there is no id#3, then $array['field1'][3] returns next result (if any). But I need it to return 0 in that case. So that $array should contain 5 elements, even if not all were in database. I...

PHPUnit, superglobal vars. How to setup test such that $_SERVER and $_GET are properly set?

Hi All, I am writing some PHP code to parse incoming URLs. It relies heavily on PHP globals such as $_SERVER and $_GET. I am thinking of manually setting these up in PHPUnit unit test setUp() function. Is there a better way of doing this? thanks, G ...

How to use only 1 query to get the data everyday within one year

Hi all, I want to get the data everyday within one year backward but I have to use 365 queries for each day like: for ($i = 0; $i<365; $i++){ $end_day = ...; // the end time of each day $start_day = ...; // the start time of each day $query = select count(*)....where created < $end_day AND created > $start_day } I think t...

php strtotime problems, giving incorrect values?

I have this code: $date = '2010-03-08 8:10:20' $new_date = date('Y-m-d H:i:s', strtotime($date . " +1 month")); echo $new_date; Btw, I already set date_default_timezone_set('Europe/London'); And the result is: 5 April 2010, 3 days missing. Why is it happen? I heard they are some bugs in strtotime? If thats the case, how to get a c...

Best web application language for Delphi Developers

I'm Delphi developer, and I would like to build few web applications, I know about Intraweb, but I think it's not a real tool for web development, maybe for just intranet applications so I'm considering PHP, Python or ruby, I prefer python because it's better syntax than other( I feel it closer to Delphi), also I want to deploy the appl...

PHP: How to use mysql fulltext search and handle fulltext search result

Hello, I have tried to use mysql fulltext search in my intranet. I wanted to use it to search in multiple tables, and get the independant results depending on tables in the result page. This is what i did for searching. $query = " SELECT * FROM testtable t1, testtable2 t2, testtable3 t3 WHERE match(t1.firstNa...