Jump to content

gristoi

Members
  • Posts

    840
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by gristoi

  1. Ok, now you've pinpointed where the issue is . You now need to see what it is trying to insert. Comment out

    if(!mysql_query($sqlPlayer, $sqldb)) die('Error: ' . mysql_error());

    And replace it with

    Echo 'query :'.$sqlPlayer.'<br/>

    and check that

    A. It is only inserting 160 records

    B. The data and user Id is correct

  2. There is still something seriously wrong if it takes 8 seconds. I have a few tables that hold around 800,000 records and take less than a second to get data from / update multiple records.

     

    You might want to have a look at the EXPLAIN function in mysql. This can help you find why your queries are running so slow. Basically, what you think your recordset is searching through and what it actually doing can be two completely different things.

     

    I have had queries that have run slow in the past and by using explain i have found that due to an incorrect query / join instead of searching through 160 rows it is actually searching through 160*160*160 .........ending up with a queries that loops through millions of rows repeatedly.

     

    It might not be this but it will be a good starting point. Also have you tried this on your localhost to ensure there is no issue with the mysql server itself.

  3. Ok, I am missing something here. What is the subscription part for. If you want to use the forum table with a primary key i would do something along the line of:

    $connection = mysql_connect("localhost", "username", "pass");
    $sql = "INSERT INTO forums (value1,value2, value3) VALUES ('v1','v2','v3')";
    $result = mysql_query($sql,$connection);
    $lastId =  mysql_insert_id();
    
    
    $sql2 = "INSERT INTO subscriptions (forumId,value2, value3) VALUES ('$lastId','v2','v3')";
    $result2 = mysql_query($sql2,$connection);
    

     

    Dont forget that if you do use an auto incimenting primary key then you do not need to put it in the insert query.

  4. have you thought of looking into printing to a PDF format instead. The reason i bring this up is that you can set the 'real world size' of the document not the resolution. There are a few good php PDF classes out there on the internet. All of the pdf classes have a new page function. So when you re loop a new bill it would start on a new page.

     

    Hope this helps

  5. If you are running these from command line then it sounds like you are not terminating the line on the query. instead of using ';' try using \g, or \G at the end of your quries

  6. I am not fully understanding your question. Basically think of the trigger as a listener. You tell it to either listen on the table for an insert or update and depending on the action performed 'trigger' a mysql query. So with that in mind what do you want to insert?

  7. hi, I have just tested this trigger in my workbench, It dosent like the -- you are using to decrease the number by one. Try

    delimiter //
    create trigger order_line_ai
    After Insert
    on order_line
    for each row
    Begin
    Set @part_num = New.part_number;
    update part set units_on_hands = units_on_hands - 1 where part.part_number = @part_num;
    End;
    //

  8. you would need to see where the existing login page is posting its data to. Then ensure that the username and password field names are the same as the existing login fields ( view the page source). Then simply post your form to the same page as the existing login form posts to. As long as there are no session / security settings with the existing login page you should not have a problem

  9. If you are using phpmyadmin you could just import the data from each spreadsheet / csv through the phpmyadmin panel, as long as the columns are in the same order for each spreadsheet then the column names are not needed for the import.

     

    Once all the data is imported it should only take a couple of queries to standardise the data :

    UPDATE tablename SET status = 'good' where status = 'g' .... Etc 
    

    Again only do this if you only need to do it as a one off , otherwise a more rigerous script would be needed. Only a suggestion , hope it helps

  10. you are calling the

    $expires

    variable before you have declared it. The code should look like:

    $submit = clean_string($_POST['submit']);
      $title = clean_string($_POST['title']);
      $story = clean_string($_POST['story']);
      $daystoexpire = '7';
      $expires = time() + (86400 * $daystoexpire);
      $datetoday = date('Y-m-d', $expires);
    
      
    

  11. If its your css that is causing you a problem then you might want to append a random number to the end of the tag. This will force the users browser the refresh to the new script.

    <link ... href="path/to/my.css?version=1234523123">

    if you are using php in the page then you could just try appending the current time to it using the time function

    <link ... href="path/to/my.css?version=<?php echo time(); ?>">

     

    this will ensure every upload is unique

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