Hello,
The query below works well. However, I would like to modify it.
I would like the ordering by when s.topten = 1 then 0 else 1 end to only be done when s.datesubmitted was less than 24 hours from the present time.
How can I do this?
Thanks in advance,
John
$sqlStr = "SELECT s.loginid, s.title, s.url, s.displayurl, s.datesubm...
I'm building a site with CakePHP, but this question is more about solving an MVC problem than it is a CakePHP problem.
I have a User Model and a Group Model. This is a HABTM relationship, so different users may belong to multiple groups. One controller on my website handles the blog. It has many methods, but all of the views share a ...
We have a custom attribute that our previous developer (recently disappeared) has created in the magento admin area. This is a getIn_stock attribute which is reading from the point of sale system to check stock levels. It is returning either a 1 (in stock) or a 0 (out of stock). I have been digging around to see how I can display differe...
How do I change the size of an icon from the JQuery theme builder? The icon is too small to use.
Setting height and width is wrong...
...
So I recently discovered that the log4* package was available for PHP and upon seeing this eagerly downloaded the latest from the log4php website and followed the installation instructions. The instructions indicate that one is to download the tar package, untar, and place the following directory in a place of one's choosing: log4php/s...
Hi All,
I'm trying to use preg_match to validate that a time input is in this format - "HH:MM"
...
i'm very noob
i want to work with PHING , but my php not have this ext
i download phing-2.4.2.zip from http://phing.info/trac/wiki/Users/Download
but i don't know to import PHING to php :(
help me ! thank !
...
I have a bunch of files in my database that I want to combine to a single PDF. I am trying to do this with Imagick. I cannot seem to find good documentation and could use some help. I want to read the binary data from my database for each file and then stream the combined file to the users.
Here is what I have:
//create the Imagick ...
Although I will be using Ruby on Rails, this is a general questions about the best way to model a database and design a custom access control system for a CMS. So it does not matter what language/db. I would be happy to hear input from all experts.
My problem:
I am in the early process of developing an online tutorial system for a local...
If I had this code:
$result = 1;
$square = array(
"00" => -1,
"0" => 0,
"1" => 1,
);
And wanted to know whether $result is equal to ANY of the array VALUES of $square (-1, 0 or 1).
I´m am guessing there should be a function that compares a variable to all the array´s values and returs TRUE or FALSE accordingly.
If there isn´t suc...
Hi all,
Still learning PHP Regex and have a question.
If my string is
Size : 93743 bytes Time elapsed (hh:mm:ss.ms): 00:00:00.156
How do I match the value that appears after the (hh:mm:ss.ms):?
00:00:00.156
I know how to match if there are more characters following the value, but there aren't any more characters after it and I d...
I used to write PHP 10 years ago. For the last few years I've been much more into the C variant languages and Perl. Any recommendations for books or resources that seem particularly well geared towards the transition from Perl to PHP?
EDIT: It turns out this has already been answered here, I just didn't see it in my search.
...
The system I'm building is attempting to read Microsoft Access DBs from a different system. I essentially need to be able to read the data, parse it, and do something with it. If I could somehow load it into an associative array, a database, or anything else, that'd be great.
Our users will have to import these files themselves, so we c...
I am using a simple PHP script for the activation part of one of my applications. The applications posts one variable to the page (http://validate.zbrowntechnology.info/WebLock.php?method=validate). The variable is the serial number, posted as 'Serial'. Each time I post to this page, it returns Invalid. Here is the code:
<?php
$serial...
I was wondering. I always do fetch and then create variables when I do loop. Is there a way to do this more efficient? Like as in automatically?
Maybe something like convert_to_variable("name","description","etc") and it'll automatically set variables for me without having to do each manually? Or maybe a single command like convert_to_...
Possible Duplicate:
Get current date and time in PHP
I was wondering how can I get the current date and time using PHP.
...
I have a facebook app that I have written in PHP/MYSQL and FBJS/AJAX. The app is Rails Across Europe, which may be found at http://apps.facebook.com/rails_across_europe (please note that it does require access to your FB data). If you would like to view a screencast of the app's operation, you may do so at http://screenr.com/TZR and http...
Hi,
I'm new to programming. I want to fetch the css saved in DB and load in a php file. I'm using CodeIgniter. After loading the css, I want to link to it as an external css. I tried following, but it is not working.
EDIT:
defaultCss.php is the file in which I want to load the css.
$strTemplate.="<link rel='stylesheet' type='text/css' ...
Hi All,
Is it possible to share admin area (having admin controllers,modules and views) among multiple projects. I want to design admin module having common functionality like admin user-role management, modules management etc. that will be shared with multiple projects. There can be possibility one of project may hold custom admin func...
Hello,
I have a MySQL query called $sqlStr5 that ranks rows by a metric called totalScore2. One of the fields that $sqlStr5 returns is called username.
I would like to echo out the rank and the value of totalScore2 where username equals a variable called $u.
How can I do this?
Below is what I have so far.
Thanks in advance,
John...