Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. I prefer kick. Could you echo out $query and see what it actually looks like. You obviously have a mysql_error but your syntax looks correct.
  2. Convert this file into a CSV (save as your_file.csv) and use this code. $handle = @fopen("your_file.csv", "r"); if ($handle) { while (!feof($handle)) { $buffer = fgets($handle); $pieces = explode(",", $buffer); $column_1 = $pieces[0]; $column_2 = $pieces[1]; echo "$col_1 $col_2 "; mysql_query("INSERT INTO table (field_1, field_2) values ('$column_1', '$co,lumn_2')") or die(mysql_error()); } } ?>
  3. If you want to switch databases, instead of closing the connection each time, just select a different one: mysql_select_db('new_db'); mysql_close(); //closes everything... don't specify a DB
  4. That's why I'm here
  5. It should work. I use a class that I include in all my files. I create an object of that class that handles queries, connections etc... Yours should still work.
  6. Pagination.
  7. Cause you don't close your PHP tag before table "?>"
  8. Are you sure? Cause that error usually means 1 thing... Could you log in to mysql with root and do "show users;" (or w/e the command is) and see if kabooc is set up with all privileges for your local server?
  9. Found this code in Google, it may be of help: if (!defined("CACHE")) define("CACHE", FALSE); if (!defined("GLOBAL_CACHE")) define("GLOBAL_CACHE", TRUE); if (!defined("TTL")) define("TTL", 15); if (!defined("PAGE_CACHE")) define("PAGE_CACHE", TRUE);
  10. 1) Wrong section. 2) Not sure what this means nor do I understand how someone could help you out with this description... 3) Do you have a question?
  11. I thought you said you tried it
  12. Welcome. Debugging is the best tool. Please mark as solved, thx.
  13. If the purpose of this is for a search, why can't you just decode the entities when you're comparing against the database?
  14. Try WHERE f.food_id = fa.food_id
  15. Seems like flyhoney's solution works as well. Output from flyhoney's: (don't know why it bullets my array I guess the "[ 0]" = a bullet point?)
  16. I think he wants to completely remove them not decode them.
  17. Before I even look at your code can you put this at the end of your queries and tell me if there are any errors? $result = mysql_query($query) or die(mysql_error()); // run query
  18. Are you looking for strip_tags?
  19. You never specify what string you want to take a sub string of. Try this and see if the correct columns print out: $field_names = array(); $result = mysql_query("SHOW COLUMNS FROM map") or die(mysql_error()); if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { if(substr($row['Field'], 0, 4) == "mem_") { $field_names[] = $row['Field']; echo "Just added: " . $row['Field'] . " "; } else { echo "Didn't add: " . $row['Field'] . " "; } } } ?>
  20. Have you tried the HTML Section?
  21. Wherever you have or are trying to display the array: echo"";print_r($field_names); The foreach traverses through the array and grabs the value and key.
  22. You could either just explode each line or convert it into a CSV file. Post a sample of what the data looks like.
  23. Try: foreach($field_names as $key => $value) echo $value . " - " . $key . " ";
  24. Where do you $_GET pagenum? How are you going to tell what page to proceed to without knowing what page you're on? And it should be (line 15): if (!isset($pagenum))
×
×
  • 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.