php

Blocking file-read in php?

I want to read everything from a textfile and echo it. But there might be more lines written to the text-file while I'm reading so I don't want the script to exit when it has reached the end of the file, instead I wan't it to wait forever for more lines. Is this possible in php? ...

MySQL Case Sensitive Tables Conversion

I have a PHP codebase that was written to address our MySQL tables in mixed case. For example, xar_intakeformgenerator_ChangeLog. Our code also runs on windows, and before we knew any better, we imported several databases on to a Windows server. This resulted in Windows MySQL changing all the table names to lower case. (xar_intakeform...

which is the best PHP framework to use for large scale web applications

We need to build a large scale web application (say... a CRM or Learning Management Systems). We plan to do it using the LAMP stack and we are still researching on as to which Framework to use. We have mainly 3 frameworks: Codeigniter Symfony Yiiframework Can anyone suggest which is the best one to choose among these? ...

Use Zend_Autoloader for Models.

Hi, does someone knows how to use the "new" Zend Autoloader to Load Models ? In the Moment my Configuration looks like this : application.ini # Autoloader Namespace autoloadernamespaces.0 = "Sl_" Bootstrap.php /** * Start Autoloader * * @access protected * @return Zend_Application_Module_Autoloader */ ...

Configure HTML Tidy to ignore PHP short start and end tags when inside html attributes

How can I keep HTML Tidy from converting PHP short tags when used as values in html attributes? Here's an example of what it currently does. It converts this: <input value='<?=$variable?>'> to this: <input value='&lt;?=$variable?&gt;'> I want HTML Tidy to ignore PHP short tags. Any config options that change this? == To simplify...

Using MySQL, how do I select query result rank of one particular row?

I've spent quite a lot of time today trying various things, but none of them seem to work. Here's my situation, I'd like to be able to select the rank of a row based on it's ID from a specifically sorted row For example, if my query is something like: SELECT id, name FROM people ORDER BY name ASC with results like: id name 3 A...

How to compare elapsed time between datetime fields?

Given 2 fields of type datetime in mySql which look like: 2009-07-26 18:42:21. After retrieving these values in PHP, how can I compare the 2 time stamps to figure out how many seconds have elapsed between them? I tried simply subtracting them but that didn't to work. ...

apache /php creates file, but same page not permitted to edit file

I've run into an issue moving onto my test (and tried it on prod, no go) where I have a php script create a file and put some data in that file. I've set the permissions to R, W, X for "Owner, Group, Other" using winSCP (i'm not much for commandline yet). What i can see is that the script is able to create the file (i've deleted, and...

What advantage is provided by object overloading in PHP?

PHP object overloading is explained here. Basically it allows you to define some custom actions when an inaccessible object property or method is accessed. What are some practical uses for this feature? ...

"Fatal error: Cannot redeclare" when reusing xml parsing code

I have a single xml parsing function that I'm trying to call multiple times as I only need to strip a little data out and continue on. Here is the function: //Parse Product ID from Product Sides function getProductSpecs($xml,$type) { // Setup arrary global $productspecs; global $count; $count = 0; global $type_chec...

trying to learn the syntax and structure of cakephp

I'm trying to write a cakephp app. I need to validate input based on availability. an example would be if someone is trying to take out a book from a library. I would reference the book to see if it's currently out, and if it is report that to the user. another example would be trying to book rooms at a hotel, the user would enter a dat...

cronjob/trigger which can update the database everyday

Hi, I am using MYSQL as my database and PHP as my programming language.I wanted to run a cron job which would run until the current system date matches the "deadline(date)" column in my database table called "PROJECT".Once the dates are same an update query has to run which would change the status(field of project table) from "open" to...

Dealing with Twitter's Ups and Downs - API

Hello all, I make use of a great class made by Jaisen: http://github.com/jmathai/twitter-async/tree/master. Recently twitter has been up and down and I am sure it will continue to be the same in the future so I am trying to cut down on my dependency on twitter being actually working. The following is what I have in my header.php and it...

PDO Catch result

How does one catch/echo the insert results? I have a insertion statement that say that no errors occured but nothing is actually placed in the database. ...

Why won't my php code "unlink" text files?

I have two text files, and a PHP script intended to delete them. My question is: why won't the two text files delete? They are both set to 777, maybe i should change permission settings? I think it's my webhost disallowing the function to execute... Here is my code: http://informationalinformation.info/fg/cron.php ...

new to mvc, dividing code question

I'm brand new to the MVC coding style and i'm having trouble deciding if i placed my code in the right place. I have a list of rates for an item, the rates have various time frames. what i want to do is display the highest rate per item for the current day. so say if item 1 has 3 rates, and 2 of them overlap today, it will choose the hig...

To find a reason of missing GET variables in PHP

How can you get the variables in URL to the next page in PHP? The user is at the URL http://localhost/codes/index.php?ask_question&amp;[email protected]&amp;passhash_md5=202cb962ac59075b964b07152d234b70 He sends a question and he goes to the following url where variables lost their values for some unknown reason. http://localhos...

PHP: What causes: "Notice: Uninitialized string offset" to appear?

Hello, I have a form that users fill out, on the form there are multiple identical fields, like "project name", "project date", "catagory", etc. Based on how many forms a user is submitting: My goal is to: loop over the number of forms create individual SQL insert statements However, PHP throws me a NOTICE that I don't seem to under...

Maximum execution time in phpMyadmin

Hello When I try to execute (some) queries in phpMyadmin I get this error Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\phpmyadmin\libraries\dbi\mysql.dbi.lib.php on line 140 because I have a very large table (over 9 millions records) I have edited the file C:\xampp\php\php.ini and changed the valu...

jquery with dynamic template div rows building

ok i have a site which has many different templates with different htmls for each template. i want to know how can i render for each row for its section with paging dynamically with jquery? i dont want to store html in a var, because it changes with template and i want to make it easy for designer without needing to know jquery code. s...