Jump to content

mac_gyver

Staff Alumni
  • Posts

    5,449
  • Joined

  • Days Won

    174

Everything posted by mac_gyver

  1. since your sql query statement is trying to return LIMIT 0, 4 rows, what's the chance of there being just one row and for if($stmt->num_rows == 1) { to be true? also, the variable you are trying to echo, $col, isn't one you are binding, so there's no way $col will contain any value that the query selected.
  2. just bumping your thread, in addition to being against the forum rules, unless you are adding or clarifying information, won't get you any help. no one has answered because the information you have supplied isn't specific. without actual or made-up xml data, that someone could copy and try, in the format you actually have in your xml file, no one here can tell you why what you are doing isn't working or what you would need to change to get this to work.
  3. Please use the forum's bbcode tags (the edit form's <> button) when posting code.
  4. there's got to be something going on with the actual filename. how about doing a var_dump() of what glob('/home/ubuntu/public_html/myfolder/*.*') returns.
  5. if you ran this code past 10:00 am, the $closing_time you are using, it won't display anything. if you meant 10:00 pm, you would need to include that when you create the $closing_time value.
  6. to do arbitrary date math, use the datetime class as it will handle the rollover in the year value for you.
  7. the following is from the forum's rules for bumping your thread - no one has replied to this thread because it lacks definition and context. no one knows what the posted examples represent, what you have tried to solve this (the posted code in no way could be producing the output shown), and where you are stuck at in doing this. next, if the examples are what is output from your own site, you would never parse the html to convert it to xml. you would take the raw data that's going into the html and produce the xml that you need from that data. to get programming help, you need to post what the input data is, showing enough context and variation to pin down what is unique about that input, what the expected output from that input data is, and what output you are getting from your code (repeat for each different variation that the code must deal with.)
  8. that's not really how programming help forums work. we're here to help programmers with their code problems and would expect the person we are helping to be able to identify/locate and post just the relevant/asked for information. it's sounding like you should post in the 'Job Offerings' forum section.
  9. if the month is greater than 12, you would subtract 12, i.e. 13 -12 = 1, 14 - 12 = 2, ....
  10. it's likely this resulted in a different default version of php or a different configuration of php that altered how the server side code needs to access submitted form data. it would take seeing the form code and the server side code responsible for handling the submitted form data to even have a chance at helping.
  11. see is php will tell you why it cannot find/access the file. make sure php's error reporting is full on, add the following two lines of code immediately after your first opening php tag - ini_set("display_errors", "1"); error_reporting(-1);
  12. i'm going to guess the actual filename is different in the code from what the actual filename is, either the spelling or CAPitalization or you might even have some white-space character(s) as part of the actual filename.
  13. i'm guessing (since you didn't show) that the end time comes from some server side code? if so, you are counting on the time zone set on the server being the same as the time zone of the browser displaying these timers. in general, you cannot guarantee that will be the case for any visitor to your site. what you should do instead is treat the time that is output to the browser from the server as a 'delta-time' and initially take the browser's current time and the value being output to it from the server and calculate the end time to be used in the code you posted above to be relative to the browser's current time.
  14. as best as i can tell, xinha is a WYSIWYG html editor, not a CMS. a CMS would use xinha as a way of editing the content using a web based interface. so, the question is, what CMS are you using? also, what debugging have you done to find out what the code is doing, to narrow down where the problem is occurring at?
  15. your assignment isn't even relevant to the error message. did you look at the error and the line of code where the error is at and TRY to determine why the function name you used in your code isn't defined? you have a spelling/naming error in the function name you typed in your code. two three serious issues with this code - 1) DO NOT use the @ error suppressor, ever. it's bad programming practice. if you are getting errors with any statements, you will need to find what is causing those errors and fix the problem. hiding the errors won't fix what is causing them and without the error messages, you won't even know where to start looking to find out why our code isn't working. 2) the mysql_ database functions are DEPRECIATED and will be eliminated in a future php version. you should NOT be learning the mysql_ functions at this point in time. see this link - http://www.php.net/manual/en/mysqlinfo.api.choosing.php 3) DO NOT nest function calls when the inner function can fail due to an error, i.e. the line in question that is producing your current error - my_sql_fetch_row(@mysql_query($q)); when you do this, you cannot test for errors, handle them, and prevent follow-on errors in the outer function calls.
  16. @xoombox, please don't start a bunch of new threads for each and every error in your code. stick to one thread for the same type of issue, in this case syntax errors that are preventing your code from even running. your two threads have been merged together. also, please use the forum's bbcode tags (the edit form's <> button) when posting code.
  17. the sql syntax of your INSERT query is incorrect. you should be forming the sql query statement in a php variable so that you can echo it to see exactly what sql query statement is.
  18. php functions, properly, have local variable scope. the only variables that existing inside a function are those that are created/defined in that function and those that are passed into the function as call time parameters.
  19. the $query = ... code should be producing a fatal error (unless your code is handling the exception itself) - Catchable fatal error: Object of class DateTime could not be converted to string ... and i'm pretty sure this behavior hasn't changed across the php versions that support the datetime class, so either the query isn't being produced at all or the snippets of code being posted isn't the whole story. (i did discover that using var_dump() on a datetime object modifies the object itself, but doesn't change the error that is produced.) in any case, as already stated, you cannot just use an object as a value without referencing the correct property or method of that object. the datetime object has a format() method that is the correct way of getting a string representation of the datetime value. ref: http://www.php.net/manual/en/datetime.format.php
  20. it's likely the (number) format that is selected for that excel column is altering the values.
  21. the only apparent problem is that your submit button doesn't have a name= ' ... ' attribute, so there's nothing to reference when the form is submitted. a comment about the database code you are showing in this thread. you would NEVER run seven queries, with seven sets of repetitive code that only varies by the field it operates on, to fetch the values from ONE row in a database table. you would run one query to retrieve the one row, fetch the data that query returned, and either use the fetched data directly as the corresponding array elements, or if appropriate, assign the array elements to individual variables.
  22. the reason your threads have gone unanswered is because you have been asking to be given code. that's not the purpose of programming help forums. programming help forums are for getting help with code you have written, when you have a problem or error with that code, or with specific programming questions. just listing what you want isn't a question at all and isn't something that a programming help forum can help you with.
  23. if you are using an array for your form fields and are getting the name 'Array' for data, wouldn't that indicate you need to use some sort of php array function to loop over the submitted data to access each set of possible values that were entered? see this link - http://www.php.net/manual/en/control-structures.foreach.php
  24. it looks like the newly inserted/updated data is probably okay, but the previously existing data (everything else) is where the white-space/non-printing characters are at, which is why i asked -
  25. please stick to ONE thread for any problem. other than the phpmyadmin edit not fixing it (are you sure you deleted any leading and trailing characters?), a common problem we see is people not actually using the output from the php trim function, so posting your php code would be the first step. where did these values originate from, i.e. how did they originally get inserted into the database table? was a file read? was something copy/pasted into a form and if so where was the source copied from, a word processor, a web page...? it's also possible that the order by term in the query is doing a type conversion and the type of this particular data is causing it to change value. we will be able to see the query when you post your code, but also post an example of some of the correctly sorted data and post this incorrectly sorted value.
×
×
  • 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.