If I define a MySQL index over two fields, how do I find out, which two belong together (using MySQL commands).
Here is an example table:
mysql> DESCRIBE lansuite_wiki_versions;
+-----------+-----------------------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default...
Hi guys,
I have the following object stored in a MongoDB:
[_id] => MongoId Object (
)
[horses] => Array (
[0] => Array (
[name] => Youve Been Mowed
[selectionId] => 3004097
)
[1] => Array (
[name] => Rascal In The Mix
[selectionId] => 3460932
)
[2] => Array (
[name] => Clumber...
Hi all, i have a string field (and i can't change this because the date format) on mysql database that contains a date (Like: "01-03-2010"), and i wan't to make a function to compare that date and return true if today's date is newer than 8 days, and false if the date is lower or bigger than today's date...
Example:
01-03-2010 < (08-06...
So, i'm having a lot of trouble with this little piece of code. An example timestamp is this: '1278509422000'.. the problem is that it comes in as a string and I have to convert it somehow. I know about the problem with milliseconds and have tried dividing by a 1000 and much more (intval/floatval) but it just will not become a correct da...
Hi,
I have a list box with two times i.e 12:00 to 2:00 and 2:00 to 4:00.I want to do that when someone submit the form (example a meeting reservation form) the timing inserted into the databse should be booked only for three times.when someone tries to insert the same time for the fourth time,it should give us message like (already book...
Is this regex perfect for any url ?
preg_match_all(
'/([www]+(\.|dot))?[a-zA-Z0-9_\.-]+(\.|dot){1,}[com|net|org|info\.]+((\.|dot){0,}[a-zA-Z]){0,}+/i',
$url, $regp);
...
UPDATED: I've simplified the code (tried to)
I'm trying to download a series of images as set in an array, but something is clearly not right:
function savePhoto($remoteImage,$fname) {
$ch = curl_init();
curl_setopt ($ch, CURLOPT_NOBODY, true);
curl_setopt ($ch, CURLOPT_URL, $remoteImage);
curl_setopt ($ch, CURLOPT_RETU...
Hi,
I'm struggling with a problem with some GIS information that I am trying to put into a KML file to be used by google maps and google Earth.
I have SQL database containing a number of surveys, which are stored in lines. When all the lines are drawn on the map, they create a grid. What I am trying to do is work out the centre of th...
We have multiple load-balanced webserver machines running the same PHP webapp (LAMP) and I'd like to run slightly different code on each server (for testing purposes). I was hoping to use the $_SERVER['SERVER_ADDR'] super global to do something like this:
if ($_SERVER['SERVER_ADDR'] == 'XXX.XXX.XXX.XXX') {
echo "Do one thing";
} elsei...
I am importing a csv file with more then 5,000 records in it. What i am currently doing is, getting all file content as an array and saving them to the database one by one. But in case of script failure, the whole process will run again and if i start checking the them again one by one form database it will use lots of queries, so i thou...
if an user login in his/her home page then he needs to see his friennds, i hane one table name
frienddetails containing userid and friendid,and another table name profile containg userid,name.now how can i show user's friend in the home page? the friend details need to show in user home page,but that is in the table named profile.
...
I am refactoring some code. I have a PHP page that contains a MySQL query and stores the result in a PHP variable $my_result. This result is then echoed to a Flash SWF during embedding with SWFObject.
I now want to call this PHP page that makes the query from a javascript function like so - one change I have made to the PHP is that ins...
hello, basicly I would like to read url params in an array so finding params don't depend on their place in url
I have a url for seach with controller/action/paramA/valueparamA/paramB/valueparamB
theses params are optional : I have direct url with search params inside
to read params from url we have to use action(valueparamA, valuepara...
I have a bunch of text on my document. You can select word/words from it and highlight the text. After you highlight it, an ajax request is sent and the selected word/words are sent to backend (PHP) and processed to be saved into the database. The page is refreshed and the selected text is permanently higlighted.
Now the bad part, if yo...
Hi All ,
1)I have been working on fetching data from an excel sheet i can see on a cell written "Oct-10" but when i select it i see "10/31/2000" on fx column right at top ,when i fetch data from the .xls sheet using http://phpexcel.codeplex.com library version number 1.7.3 ,it is returning float("40482") , can any body tell how to conver...
hi guys
i am a fresher n don't know about java.
i created and published some reports to jasperserver using ireport,
now what i have to do is insted of logging into jasperserver i have to view my reports in myown site.
i tried it by using php/java bridge but not got the solution.
can any body provide me the steps to be followed in cl...
I'm looking for best framework in order to generate and validate forms in php.
I would really like it to be based on smarty too.
Any suggestions?
...
Hi all, i have developed a php-mysql web application, which is a school based project.
My client wants the this application to be converted into a .exe file such that it can be installed on his desktop and use it.
How can the php website can be converted to a .exe file and can it be run without the need of a database/server software ?
...
I have a unique requirement where I want to run PHP 4 and PHP 5 on the same web server. How do I acheive it ?
...
Hi all , Can any body give me a a introduction of how to program efficiently minimizing memory usage in PHP program correctly and generate my program results using minimum memory ?
...