Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by bubblegum.anarchy

  1. SELECT * FROM guestbook WHERE titleID = {$titleID} $titleID would first require approriate injection protection if the value is being passed from browser input. something like settype($titleID, "integer"); to ensure that $titleID holds an integer rather than malicious mysql code.
  2. Define the format in mySQL with str_to_date() UPDATE table SET date = date_format(str_to_date(date, '%Y-%d-%m'), '%Y-%m-%d')
  3. no no - post the string stored in the variable $sql during the files processing, not the entire files code.
  4. um.. I don't know, how about replace ENGINE with TYPE. EDIT: FYI - the above create query works perfectly fine via SQLyog and also try removing the backticks from the KEY column names: KEY `group_id` (group_id), KEY `forum_id` (forum_id)
  5. Remove the space between the closing paranthesis and the word ENGINE.
  6. Open the sql dump in vim and see whats what.
  7. well.. the error is near the weird characters: MySQL: You have an error in your SQL syntax near '-- phpMyAdmin SQL Dump CREATE TABLE `bbnboard_auth_access` ( `group_id` med' at line 1
  8. Remove the line that is causing issues since the issue appears to be related to the commenting prefix in a commented line.
  9. One insert at a time for each value in the select box.
  10. This was extremely tough: SELECT games.division, games.user, sum(games.payout) FROM games INNER JOIN ( SELECT substring_index(group_concat(pkey ORDER BY games.division, games.user, games.payout DESC), ',', 3) AS top_three_pkey FROM games GROUP BY games.division, games.user ORDER BY games.division, games.user, games.payout ) AS top_three ON find_in_set(games.pkey, top_three_pkey) GROUP BY games.division, games.user
  11. There is no problem - the $_POST data is supposed to only hold one item, the selected item, this is the purpose of the $_POST data.
  12. http://dev.mysql.com/doc/refman/5.0/en/stored-procedures.html
  13. yeah, apply mysql_real_escape_string() to each $_POST value and add quotes. ... and the ending paranthesis is missing.
  14. ORDER BY defaults to ASC - no need to explicitly define the sort direction. isar21: post the complete SQL query, and also where the $select, $from, $where and $how variables are combined.
  15. $_POST['typeList'] holds one item, the selected item.
  16. Make no difference compared to what? The number of records in a table is more costly than the number of tables in a database, afaik.
  17. SELECT sum(Time_Taken) FROM call_event WHERE call_id = $call_ID
  18. $count_query = mysql_query('SELECT COUNT(*) FROM table'); $getcount = mysql_fetch_row($count_query); $count = $getcount['0']; vs. $count_query = mysql_query('SELECT * FROM table'); $count = mysql_num_rows($count_query); One record is loaded into memory vs all the records loaded into memory $query = mysql_query('SELECT * FROM table'); if (!$query) die(mysql_error()); vs. $query = mysql_query('SELECT * FROM table') or die(mysql_error()) not a great deal or difference - readability mostly.
  19. Sessions can also store the shopping progress and when complete be placed into the database as a more permanent record.
  20. Probably one of the best aspects of MySQL procedures is the ability to move all the common database abstraction done in php (or whatever language) back to the more appropriate location of MySQL. So instead of a php file that contains a common function to return account details, the same function can be defined in a procedure and used simply in php or any other language base.
  21. Why are you expecting a result if you are getting a zero row count ?
  • 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.