I'm still not convinced after my previous question and some experience.
Requirements:
I don't want to use an SQL query everytime a filterBy() function is called and still be able to call ->filterBy() on the returned table.
Please find the comment @ ObjectsTable class: "How to instantiate another table and add records which match t...
Hi,
I am trying to select between two dates, but in the table they have timestamps after them.
Example: calldate is 2010-03-16 22:43:28
How would I select this using calldate between '$date1' AND '$date2' to wildcard the timestamp after the date?
I tried using like but it didn't work
I just want to do between '$date1%' AND '$date2%...
Is it possible to use fgetcsv in PHP to open a tab-delimited file?
...
I'm running a curl request on an eXist database through php. The dataset is very large, and as a result, the database consistently takes a long amount of time to return an XML response. To fix that, we set up a curl request, with what is supposed to be a long timeout.
$ch = curl_init();
$headers["Content-Length"] = strlen($postString);
...
I'm using the following regex to validate password complexity:
/^.*(?=.{6,12})(?=.*[0-9]{2})(?=.*[A-Z]{2})(?=.*[a-z]{2}).*$/
In a nutshell: 2 lowercase, 2 uppercase, 2 numbers, min length is 6 and max length is 12.
It works perfectly, except for the maximum length, when I'm using a minimum length as well.
For example:
/^.*(?=.{6,})...
I'm using HTMLPurifier in a current project and I'm not sure about the most efficient way to go about handling multiple configs. For the most part the only major thing changing is the allowed tags.
Currently I have a private method, in each class using HTMLPurifier, that gets called when a config is needed and it creates one from the de...
Hello guys,
I've searched but was unable to find an existing regex function. Has anybody done this before?
I wish to add a port number, or remove a potantially existing one from a url in php. To use in some functions which translate a given url to the secure one, unsecure one, etc.
Now I need a second SSL secured site on the server so...
Really quick here... I think I have the answer, but just looking for some validation.
I have a site with two "points of entry." One is for a standard user and one is for an admin account. In the real world, an admin could have a standard user account and try to login as an admin while already being under the standard user session.
I ...
I have an one to many association in which a Thing can have many Statuses defined as below:
Status Model:
class Status extends AppModel
{
var $name = 'Status';
var $belongsTo = array(
'Thing' => array(
'className' => 'Thing',
'foreignKey' => 'thing_id',
);
}
Thing Model:
class Thing exten...
I'm not sure how create a right query to get the result I'm looking for. What I have is 2 tables. first has ID, Name columns and second has date and adminID, which is referenced from table 1 column ID. Now, what I want to get is basically number of times each admin loged in per day during the month.
ID | Date
------------------
4 |...
I am trying to save data into a database using PDO. All columns save correctly with the exception of one. No matter what I try, I cannot get the data to go in.
myfunc($db, $data) {
echo $data; // <----- Outputs my data. example: 'jim jones'
$stmt = $db->prepare("CALL test(:id, :data, :ip, :expires)");
$stmt->bindParam(':id...
I had a client who had MySQL Strict which brought up a few errors in my MySQL code... I didn't even know there was a MySQL Strict. I've fixed up a lot of the issues but I want to run some further tests on my local server.
How do I enable MySQL Strict for testing purposes and then disable it when I no longer want it?
...
I have previously baked a controller for a model that I have created.
When attempting to bake the view using cakephp I get the following errors:
Interactive Bake Shell
---------------------------------------------------------------
[D]atabase Configuration
[M]odel
[V]iew
[C]ontroller
[P]roject
[Q]uit
What would you like to Bake? (D/M/V...
Hi, I'm new to codeigniter this is my case:
I have a homepage with a list of items, I can navigate through pagination, but I have in my sidebar a login form, it's possible to return to the same page after try to login in the case that is valid or not with a validation message.
for the login option I have a controller and login function b...
$page = $curl->post($baseUrl.'/submit.php', array('url'=>$address,'phase'=>'1','randkey'=>$randKey[0],'id'=>'c_1'));
$exp = explode('recaptcha_image',$page);
The id recaptcha_image is not found although if i echo $page; the webpage will be displayed and surprisingly even the recpatcha div (with the image itself). Curl shouldn't load th...
I am trying to fix a regular expression i have been using in php it finds all find filenames within a sentence / paragraph. The file names always look like this: /this-a-valid-page.php
From help i have received on SOF my old pattern was modified to this which avoids full urls which is the issue i was having, but this pattern only find...
I've installed php fastcgi for Apache2 by this doc:
http://library.linode.com/web-servers/apache/php-cgi/ubuntu-9.10-karmic
Pages is opening fine. But I don't understand why I can't see php5-cgi process [ > top ]
Looks like apache run php5-cgi for each request, but processes should be already run.
Could you help me to find the probl...
Hello,
I'm working on a PHP app, and I'm trying to find the best way to set up a calendar system.
First let me describe the intended function of the system: The application has multiple users who can login simultaneously. Each user should be able to add their own events and display them on their "profile." Also, on another page, the ev...
How do you make a function read form a txt file and store random lines in a variable? It will be run over and over in a foreach loop. The language is PHP.
Im a new coder so I don't know things like this off the top of my head.
...
I found a very helpful post on here about cropping images in a circle. However, when I try to execute the imagemagick script using exec in PHP, I'm getting no results. I've checked to make sure the directories have the correct permissions and such. Is there a step I'm missing?
Any insight would be much appreciated. Here's what my script...