Jump to content

RussellReal

Members
  • Posts

    1,773
  • Joined

  • Last visited

Posts posted by RussellReal

  1. you're not finding it because first comes before second, and "sec" doesn't exist in "first" and either way if it matches or doesn't match, you die() the script.. take the die() out of the else statement and you should be okay..

     

    <?php

    $array=array('first','second','third','3423a','3423');

     

    foreach($array as $arrays){

    $result=strpos($arrays,'sec');

    if($result!==false){

    echo 'found it<br />';

    die;

    } else {

    echo 'NOT found it<br />';

    }

    }

    ?>

  2. no, your post is very detailed, *thumbs up*.

     

    unlink deletes files, when you click on whatever options you have in your interface, run unlink on the file and it should trash the file from the server..

     

    date created idk about..

     

    if you mean date created on the uploader's end.. idk if you could..

     

    but! You could record the date UPLOADED with date

  3. just as a side note..

     

    // Select DB

    $db_select = mysql_select_db("hightrek", $connection);

     

    you don't need

     

    $db_select =

     

    you could just do

     

    // Select DB

    mysql_select_db("hightrek", $connection);

  4. you want a desktop application to connect to your php mysql panel type thingy..

     

    if it is ALREADY configured in your php.. and it completely works with your php

     

    then all you need to do is show what the php shows..

     

     

    so make your vb app or whatever, connect directly to your php (with a web browser ofcourse) and then you have a desktop app.. in like 2 minutesa

  5. chronister you came on here acting so nice :( you make me feel bad lol! but yeah, mysql really does help handling data ALOT, and its so much faster to let mysql do all the cataloging and greabbing and parsing, all you do is REQUEST the data, and then handle it.. its like effortless, rather than with a text file create a system which allows you to edit, remove, add, grab, parse, from a plain text file, and still hold its place within the file.. save the effort and just get hooked on mySQL :P practically all my applications I code, use mysql now, unless its a parser or sumfin simplistic like that.

  6. probably will be your only constructive post here..

     

    This isn't for script requests, although you may see us write scripts for people, we write scripts to correct already written code or to help correct a problem with already written code.

     

    I'm not trying to come off like a prick, but most of us spend alot of time on this forum and like helping people, and thats what we intend to do, HELP, but give out.

     

    I know this is a help request though but many people will most likely disregard this after you have "someone write the basic code for me" in the thread..

     

    unless maybe I'm speaking for myself ofcourse, however, unlikely.

     

    I can however point you in the right direction, then when you have some established code we can try to help you with errors you encounter.

     

     

    I recommend you use mysql (#1), you can get the date using date, although for databases you should use the timestamp, that way you can code with it (all languages are more mathematical than anything else).

     

    to check for past events, you would use an if statement and compare time with the timestamp in the database, "if timestamp less than time THEN its older OTHERWISE (else) its new"

     

    this is actually pretty simple..

     

    hope I help you bro and sorry for sounding snobbish

  7. any extra un needed cpu time is worthless..

     

    if you took a string that was 300k charslong.. which is possible.. and applied the following function 10 times to the string..

    function abc($string) {

      return strlen($string);

    }

    then applied the above function 10 times to a string like "hello" you can assume that it would run slower on the first one than the second one.

     

    now, thats because its more data for php to handle, having many resources you'd assume works the same way..

     

    resources are exactly that, resources. You take a 10 mysql connections, the amount of memory to keep reference to the 10 mysql connections is much more than you'd expect php to need, even idle its like adding white feathers to a box of offwhite feathers and trying to seperate em in order to count em.

     

    its going to take a while, but if its just 1 offwhite feather and 1 white feather, its much quicker to do this operation.

     

    maybe I exagurated with 10x but any performance loss is performance loss..

     

    that is why they created mysql_close() to free the allocated memory of that resource, before termination of PHP, to keep your scripts running efficiently.

     

    is all I was tryna explain

  8. directed @ the people above talking about mysql connections

     

    they are right as when PHP exits, all resources, (sql result resources, sql connection resources, socket connections, etc) are all destroyed

     

    you need not close mysql connections unless you are going to use more than 1 connection, and you want to cut down on the weight you're putting on your server.. if you have 10 connections open you can assume that the script will run 10 times slower, but since scripts process so quickly it might go from like 1ms to 10ms and you'd hardly notice the difference..

     

    but take that 10ms and multiply it by the amount of users on your website and that = heavy on your server.

     

    although I'm not exactly sure if my timing is ACCURATE so accuracy ninjas please don't attack me for saying 10ms when its really 5.89273 ms for 10 connections lol..

     

    so if you're terminating a mysql connection then trying to use it later, its obvious there is going to be an errror..

×
×
  • 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.