I'm looking for a code snippet which categorizes mime types.
For example,
application/msword
application/vnd.oasis.opendocument.text
application/pdf
Both of them are office files. When I pass these mime type to the function, I want it to return a result which is 'office', 'image', 'application', 'compressed' etc.
However,as you kn...
In which cases, except development, would you prefer Xampp over a complete installation and configuration of Linux, Apache, MySQL, PHP.
...
hi, i have this table contains name and value, how can i convert the contents of
$row=mysql_fetch_array($result);
into check boxes
...
I understand that the question is rather hard to understand, I didn't know how to ask it better, so I'll use this code example to make things more clear:
If I have the following files:
test.php:
<?php
include('include.php');
echo myClass::myStaticFunction();
?>
include.php
<?php
__autoload($classname){
include_once("class/".$cl...
Hi,
how do you embed your sql scripts in php? Do you just write them in a string or a heredoc or do you outsource them to a sql file? Are there any best practices when to outsource them ? Is there an elegant way to organize this?
...
I need to generate a list of sequential numbers. I know Ruby you can do 1..10 or PHP you can do range(1, 10). Anything like that in .Net already, or do I have to write it? Thanks.
...
I need to create Snapshots / Thumbshots / Site preview a-site.com.
There are some site as thumbshot.org that meets with I need. But I do not want to use an external service, not to depend on others for my project (What would happen if they close the site?)
For this reason, I am looking for some project to let me do this.
Any idea?
...
Is the any difference between writing
{$_GET['id']}
and
'".$_GET['id']."'
in a sql statement? both works the same
...
I'm using Zend Framework 1.7.2, MySQL and the MySQLi PDO adapter. I would like to call multiple stored procedures during a given action. I've found that on Windows there is a problem calling multiple stored procedures. If you try it you get the following error message:
SQLSTATE[HY000]: General error: 2014
Cannot execute queries ...
I am having a few issues when people are trying to access a MySQL database and they are trying to update tables with the same information.
I have a webpage written using PHP. In this webpage is a query to check if certain data has been entered into the database. If the data hasn't, then i proceed to insert it. The trouble is that if two...
Hi,
I'm looking to implement user login onto my site for the first time. I'm happy to either build my own solution, or implement something open source, however no package has been an obvious choice in my search so far. Equally, I'm fully aware that as an intermediate php programmer at best, I am highly likely to miss something obvious...
New to PHP and web development in general. I am trying to get information from an HTML form to appear in a table on another web page after clicking submit. So I installed Apache and then PHP on my local PC and expected to be able to test a PHP script locally however it does not return the information I was expecting.
The following is th...
I have a date and time column in my mysql table called start_date and start_time respectively. I want my users the ability to set reminders for themselves to be sent X hours before start_time, min. 1 hour and max 24 hours.
I'll be running a CRON script to send these reminders. Right now I do:
SELECT * FROM auctions WHERE start_date=CUR...
UPDATE: Rephrasing the question to ask, 'are there too many' static methods (I realize that right now there are only 4 but I originally started with 2) in this class structure? If so, any suggestions on how to refactor these classes to use some sort of Finder class so that I can remove the static functions from the Model classes?
I have...
After searching around somewhat thoroughly, I noticed a slight lack of functions in PHP for handling IPv6. For my own personal satisfaction I created a few functions to help the transition.
The IPv6ToLong() function is a temporary solution to that brought up here: How to store IPv6-compatible address in a relational database. It will sp...
$('#images_upload_add').click(function(){
$('.images_upload:last').after($('.images_upload:last').clone().find('input[type=file]').val('').end());
});
using this code to append file input's does not upload the file in firefox.
also
$('#image_server_add input[type=button]').click(function(){
var select = $(this).sibling...
I know how to generate a random number in PHP but lets say I want a random number between 1-10 but I want more 3,4,5's then 8,9,10's. How is this possible? I would post what I have tried but honestly, I don't even know where to start.
...
I'm fairly new to the Zend Framework and MVC and I'm a bit confused by Zend_DB and the proper way to interact with the database.
I'm using the PDO MySQL adapter and have created some classes to extend the abstract classes:
class Users extends Zend_Db_Table_Abstract {
protected $_name = 'users';
protected $_primary = 'user_id';
...
I have the following tables in mysql:
team: id, name, [more stuff]
person: id, name, team, [more stuff]
entry: id, name, team, [more stuff]
registrations: id, event_id, team, status
registration_people: registration_id, person_id
registration_entries: registration_id, entry_id
I would like to query the database and return details abou...
I have been starting to write some reasonably large and or confusing MySQL queries in PHP. I am trying to find a balance between verbosity and performance... If performance has anything to do with it or not is my question.
It being white space and MySQL comments inside of my queries. It would make sense to me that PHP would filter the q...