Jump to content

gurechan

Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Posts posted by gurechan

  1. I have a table in mysql and one of the fields contains dates formatted 'DD-MM-YYYY'.

     

    I've been trying to order the results by the date field using:

     

    SELECT * FROM table ORDER BY DATE_FORMAT(date, '%d-%m-%Y') ASC

     

    But this doesn't order the results correctly. I've googled it a bit and I think I've got this correct.

     

    Can anyone help, and let me know the correct way to do this.

    Thanks

  2. I have a list on my website that is generated from a mysql database with php. The order of this list can be changed by using up and down arrows (images that I've created) and a php script that I've written.

     

    The only minus to this is that when an arrow is clicked to move a list item the page needs to re-load to call the php script.

     

    I would like to use an Ajax function to call the php script instead, but can't seem to find a good example/tutorial on the web. Can anyone help me out or point me in the right direction.

  3. Hi, I know that strstr can be used to return the part of a string that appears after a specific character. I was wondering if there is a function that can return the part of the string that appears before the character?

  4. Hi, I'm trying to set up a search form and using the LIKE command in MySQL, ie:

    SELECT * FROM books WHERE title LIKE '%$search%'

    Now say I have a heap of books that have the work [b]book [/b]in the title, this query works fine if you enter book in the search field, but if you enter [b]books [/b]you get no results.

    Is there an easy way to get it to still find a match.
  5. Hi, I am trying to set up an upload script in php using:

    $updir = "../files/";
    $file = $_FILES['file']['name'];
    if(!(copy($_FILES['file']['tmp_name'], $updir . $_FILES['file']['name']))) die("Cannot upload files.");

    What I want to do though is rename the file on upload. For examle:

    From: abc.some_file_extension
    To: 123.some_file_extension

    Can anyone point me in the right direction?
×
×
  • 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.