Include constant in string without concatenating
Is there a way in PHP to include a constant in a string without concatenating? ...
Is there a way in PHP to include a constant in a string without concatenating? ...
as the title of the question suggests, my question is simple, which one is better in terms of performance knowing that i'm on a linux shared hosting, siteground.. i'm capable of coding both, i actually coded a one that updates the DB, but from reading around some people suggested to insert and not to update.. any feed back is much apprec...
how do i call a static method from another method inside the same class? $this->staticMethod(); or $this::staticMethod(); ...
I have a strange bug where I call an insert query, it executes successfully (the row appears in the DB) but mysql_query returns false. It only returns false when a particular field contains an underscore or dash (or probably some other chars but these are the two I've run into so far). "INSERT INTO Hoopoes (name, owner, dbuser, dbpass,...
could i use nonstatic members inside a static method? eg. $this->nonStaticProperty $this->nonStaticMethod() and vice versa that is to say use static members inside non-static methods? ...
Hi There, I am putting together a few models for my codeigniter site and can't seem to find any word in the documentation of how to handle errors that could occur when using the Active Record system. The documentation demonstrates how to perform CRUD along with some relatively involved queries but no where along the line is error handli...
I'm investigating options to create a database cache using HSQLDB in an in-memory mode. The idea is that the cache will be queried from a PHP application and the query will be passed to a Java application that runs the HSQLDB database. Now, I've been thinking this through and I can't see any efficient way to pass the data from Java bac...
In Kohana 3, I can bind a param in a query like so $query = 'SELECT name FROM users WHERE id = :id'; This is neat, but sometimes I want other things to be configurable, like the table name. When I use a named param for table name, it fails. I have just been building the string in these circumstances. My question is, how can I escape ...
when I was looking for some MVC framework, I got the website: http://www.phppatterns.com/docs/design/archive/model_view_controller_pattern however, like the code listed there makes me confused about references. For example: $dao=& new DataAccess ('localhost','user','pass','dbname'); $productModel=& new ProductModel($dao); each ...
I'd like to make a website, it's not a huge project, but I'm a bit out of the web design loop. The last time I made a website was probably around 2002. I figure the web frameworks and tools have come a ways since then. It's mostly the design aspect that I'd like it to make easier. I can do the backend language in any language. My qu...
The tutorial that I'm trying to figure out is this: http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/ The username field looks like this: <input value="" class="validate[required,custom[noSpecialCaracters],length[0,20],ajax[ajaxUser]]" type="text" name="user" id="user" /> That <input> ...
I can't figure this one out; it's probably really obvious to everyone's eyes except mine. Here is my update method for Kohana 3. public function update($type, $id, $updates) { $info = $this->getInfo($type); $dbTable = $info['table']; $updatesKeysToValues = array(); var_dump($updates); foreach(...
I have a file http://www.www.com/somefile.php I would like to be able to get to the same file by going to http://www.www.com/somefile But I still need http://www.www.com/directory to open the file http://www.www.com/directory/index.php if, in fact, directory is a directory. This is a typical LAMP setup with Red Hat and Apa...
I am building a Facebook app using iframe rendering. I want to use CodeIgniter for the back end and am wondering what all the settings should be set to for CodeIgniter and Facebook to get along. Specific settings I am wondering about are: Facebook's canvas callback url (should it include the default controller and function)? config.php...
Is there any CMS in PHP in just 1 file? EDIT Thank you for all your suggestion. I can choose only 1 so I'd choose the one by Chacha102, which I could not find when Googling. You all earned my vote. ...
Hello, I am creating to pg_dumps, DUMP1 and DUMP2. DUMP1 and DUMP2 are exactly the same, except DUMP2 was dumped in REVERSE order of DUMP1. Is there anyway that I can sort the two DUMPS so that the two DUMP files are exactly the same (when using a diff)? I am using PHP and linux. I tried using "sort" in linux, but that does not work....
With the Zend Framework, I am trying to build routes for a REST api on resources organized in the following pattern: http://example.org/users/ http://example.org/users/234 http://example.org/users/234/items http://example.org/users/234/items/34 How do I set up this with Zend_Rest_Route? Here is how I have setup the route for the use...
i m adding an book detail in a page(book_detail.php), when i add book information ,i m also adding offers and addons via iframe( using lightwindow.js) related with that book and i saved their id;s in 2 session array. if someone add 2 addons and 3 offers related to that books, i store those addons_is and offer_id in session and when i ...
I know I'm missing something easy here... I've been trying different operators, but haven't been able to figure this out... How do I go about checking to see if the current date is between two other dates? So, if I have a from date of 2/2/2010 and a to date of 2/10/2010, how can I return TRUE if the current date (2/4/2010) falls betwe...
I developed a small nifty webserver in C and would like to evaluate its performance. For this I'm doing the following: Measuring the socket establishment time, file transfer time (for files of random sizes) and socket teardown time in the following scenarios: Single-Threaded Multi-Threaded And this should give me the throughput/band...