Jump to content

mac_gyver

Staff Alumni
  • Posts

    5,510
  • Joined

  • Days Won

    185

Everything posted by mac_gyver

  1. next try this - http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_convert-tz ---------- well, yes you can. if you are using php date/time functions you can set the timezone php uses to GMT using date_default_timezone_set() and you can do the same for mysql date/time functions using the SET time_zone = ... query that requinix showed you. ------------ you should store the date/times as GMT. then if the timezone database that mysql is using is up to date, the mysql convert_tz() function should take into account the DST start/stop dates of the timezones you put into it.
  2. if you look at the color highlighting in your posted code, it will lead you to the source of the problem, because the colors change to that of a quoted string and don't change back. hint: there's a missing single quote ' near the end of a line.
  3. because the definition contains ; delimiters, you must temporarily change the delimiter to something else so that those characters can be stored in the definition instead of being treated as a delimiter. how are you importing this?
  4. what dimensions are the smiley1.png image? it may be that you are just copying a small back section of it onto the other image.
  5. there's nothing in the errors that are specific to the database name. the SK_MySQL part is a class name. it may have been the same name as the database name, but that's not the reason for it appearing in the error message. the only thing that the error you posted tells is that the connection is failing. to find out specifically why it is failing, you would need to echo mysql_error();
  6. $num = "1234567890"; echo number_format($num,0,'', ' ');
  7. the code i posted isn't a copy/paste 100% complete tested solution, especially since no one here knew you were even outputting this to flash. it is an example showing how to use shuffle() to sort the rows in your $arr and to loop over the resulting random rows. if your code is doing more than that, it is up to you to take the method shown in the example code and modify it to suite your needs.
  8. that code cannot produce repeated questions, unless you have rows in your database table that are repeats. since we only see the information that you post, perhaps you should copy/paste what you see in the browser.
  9. you would post the same section of code that is in the first post in this thread, but what it currently is.
  10. cannot possibly help you with your current problem without seeing the code that produces the problem. changing one character or one line in code can completely change the result.
  11. shuffle should not produce the same result each time. with a small set of data, you may see the same result multiple times, but it should not be the same result every time. did you try it more than once and what's your current code?
  12. the URL you are building and using in the AJAX request would need to have the subcat=x parameter, in addition to the page=y parameter.
  13. your value=' ... ' has got a leading space in it (after the first " and before the ' )
  14. i have a recommendation for using a switch/case statement to map one value to another, especially since you already have an array that is mapping one value to another. don't use a switch/case statement to map one value to another, just expand your existing array. this will significantly reduce the amount of code and will point out things like missing values (your posted code doesn't handle the 'flood' value for $typeKey.) your array - $stormTypesAry['tornado'] = array('name' => 'Tornado', 'color' => 'rgba(128, 128, 128, 0.4)'); $stormTypesAry['funnelcloud'] = array('name' => 'Funnel Cloud', 'color' => 'rgba(255, 222, 173, 0.4)'); $stormTypesAry['wallcloud'] = array('name' => 'Wall Cloud', 'color' => 'rgba(255, 20, 147, 0.4)'); $stormTypesAry['rotation'] = array('name' => 'Rotation', 'color' => 'rgba(255, 228, 181, 0.4)'); $stormTypesAry['hail'] = array('name' => 'Hail', 'color' => 'rgba(255, 255, 0, 0.4)'); $stormTypesAry['wind'] = array('name' => 'Wind', 'color' => 'rgba(255, 0, 0, 0.4)'); $stormTypesAry['flood'] = array('name' => 'Flood', 'color' => 'you don\'t have an entry for this'); $stormTypesAry['flashflood'] = array('name' => 'Flash Flood', 'color' => 'rgba(255, 165, 0, 0.4)'); getting both values at once, without writing line after line of hard coded logic for each value - // get the stormType and reportColor using the $typeKey $stormType = $stormTypesAry[$typeKey]['name']; $reportColor = $stormTypesAry[$typeKey]['color']; // this line takes the place of all the switch/case logic also, by having less code, it will be easier to see the errors in your logic.
  15. how are you producing the value in $_POST['horse']? it might have a non-printing character as part of it that echoing it doesn't show.
  16. break the file up into smaller pieces and send one at a time or don't try to send it as an email attachment.
  17. you are making this harder that it is. a function should do one thing really well. a function named get_value() should just do that one thing. a function should also return the value so that you can use the function in any context. if you use the function in your form, you can echo the returned value. if you need to put the value into a query, you can call the function at the point where you are putting values into a query.
  18. if you have an arbitrary list of data you are traversing, you must find the next/previous based on the current id that was submitted, either by querying the database where you originally got the list from or by storing the list in a session variable.
  19. the error mentions an amount of memory larger than the file because the output from base64_encode is about 2/3 larger than the original.
  20. your get_value() function should do one thing, what its name implies. it should get the value from the correct $_SESSION variable. all the values should either be in session variables or they don't exists at all at the point where you are building the form and if they do exist they should have been stored in the session variables at one point, where you detected that the form was submitted, in your form processing code. you should have specific and distinct code that process the form data and specific and distinct code that builds the form.
  21. you are not echo'ing the mysqli_error. change your code to this - echo mysqli_error($link);
  22. since the $_POST array is apparently set, it's highly unlikely that the $_FILES array will be empty unless your form is invalid or uploads are not enabled on the server. have you successfully uploaded ANY file on this server? what does the output from a phpinfo() statement show for the file_uploads setting? does your form page have other forms on it, possibly breaking the <form> tag you did show? what is the complete 'view source' of the form page?
  23. practices are only good if they make sense in the context where you are using them. blindly applying practices in all situations, can lead to bad results.
  24. that's not an answer to - what significance is there to what box any item is located in? that's a statement of what you are doing. why not just display the items in any person's inventory, in the boxes, in alphabetical order or in the order they were acquired in, starting at the top-left box? you are having difficulty with storing the location, just think how much code it will take to allow someone to change the location and prevent overwriting a location already in use?
  25. i was reading your thread on one of the other programming help forums where you started out the thread by stating that the .htaccess file breaks all your styles. that tutorial contains a comment that EVERY .css file in the folder where the .htaccess file is at must have the header() statement in it. only put your dynamically produced .css files in the folder with the .htaccess file. put regular .css files somewhere else.
×
×
  • 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.