Jump to content

gristoi

Members
  • Posts

    840
  • Joined

  • Last visited

  • Days Won

    1

Everything 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. cheers thorpe. My bad. Have always been taught to use the keyword abbriviations.
  4. couple of things. Try and keep your syntax the same. Line 4 of movie1.php is in lowercase: $_session // should be $_SESSION and on line 8 you are using the word 'and'. This needs to be &&.
  5. Basically, if the last thing inserted into a table by sql had an auto incremented primary key then that function would retrieve the designated key. comes in very handy
  6. 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.
  7. you would use the subscription Id (primary key) as a foreign key in the forums table. or vice versa. That is how you reference the relationship between the tables
  8. Instead of using a random string why not use an auto incrimenting primary key for subscriptions. Then each one would have to be unique
  9. your using $Email = mysql_real_escape_string($_POST["Email"]); but calling lowercase email filter_var($email, FILTER_VALIDATE_EMAIL)
  10. 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
  11. 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
  12. 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?
  13. You have a few problems. A couple of things you can do to speed things up are: a. Index your tables correctly. This will increase the speed dramatically. b. use a table join in your query. As a matter of principle I always use a join and never ( if i can help it ) use a query within a loop
  14. 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; //
  15. try ($Name == '' || $Phone == '' || $Email == '' || !preg_match('/^[A-Za-z0-9\-.]+$/', $domain) ||
  16. you cant nest the else if within an IF statement like that, change it to an OR ||
  17. Have a look at usin a class called mpdf. This allows you to create PDF tables from HTML
  18. If your using google chrome or firefox you can use the firebug plugin. This tool with help you with all JavaScript related errors
  19. 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
  20. $date = date('Y-m-d'); Use - not .
  21. You have only queried the database and not fetched the resource fully. You need to loop through the results: $query = mysql_query( query here ........); While ( $row = mysql_fetch_array($query)) { Return results ...... }
  22. 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
  23. Looking at the include path the framework is looking for Zend/Loader. Where you have called your folder zend with a lowercase Z
  24. 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);
  25. 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.