Jump to content

systemick

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Posts posted by systemick

  1. The mysql_real_escape_string function will prevent sql injection. The only other thing I would add is that you don't need the first 2 lines of code. You could just write

     

    $check = mysql_query("SELECT email FROM users WHERE email = '".mysql_real_escape_string($_POST['mail'])."'")

  2. You don't say if the timestamps are unix timestamps. If they are and you wanted the number between 6AM and 12PM today the sql would be:

     

    "select count(*) from event where event_time >= unix_timestamp('2010-08-06 06:00:00') and event time <= unix_timestamp('2010-08-06 12:00:00')

  3. Take a look at the usort function here:

     

    http://www.php.net/manual/en/function.usort.php

     

    You could define a function

     

    function compare ($array1, $array2) {

      if (array1['discount'] < array2['discount']) {

        return -1;

      } else if (array1['discount'] > array2['discount']) {

        return 1;

      } else {

        return 0;

      }

    }

     

    then pass the name of this function as the 2nd argument to usort

  4. I use Fedora 12 and on my machine they are located in /var/lib/mysql but on a different OS they will be in a different place. my.cnf is the main mysql config file and the location should be listed in there. On Linux it is usually located in the /etc directory. If all else fails try searching your machine for a file or directory that is the same as the name of one of your databases.

  5. I'd agree that the LAMP stack works pretty much on any server and that Centos works pretty well if all you need to do is serve PHP pages. There is one thing that I would say about Centos though. It can be difficult to install software on Centos sometimes because the packages quite often only exist for Fedora and Ubuntu. I have just set up a web application that needed to use a piece of third party software that is not widely available. Installing this software on my Fedora development box was easy but I tried for a whole day to install it on the live Centos server without success. Eventually I gave up and asked the hosting company to set uf a different server with Fedora on it.

  6. Please forgive me if this has come up before. I searched and couldn't find anything. Could anyone recommend a decent free IDE for coding PHP. I'm on Linux and have always used Kate but now I have upgraded to Fedora 12 the latest version has some major changes and I'm no longer happy with it.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.