Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Its telling you that the var you are attempting to bind to (the connection?) is not valid. Check that it happened correctly with a little more code and turn on error checking Check the prepare. Is everything correct in that insert query statement?
  2. So then NotSunFighter had the right approach. And using the number_format function would allow you to adjust the presentation.
  3. Your calculation produces 1350 which is square meters, but what 'unit' does 1.350 become?
  4. YOu should have php error checking turned on. YOu would have probably gotten a warning message at least if you did. As for the user info - put it all in the users table. Then only use the user_id in any other table and make your connections using that alone. In a properly-designed database you should never have to duplicate a value in a second table which is what you are doing with user_name.
  5. Why do you have a user_id as well as a user_name in this table? Do you have a 3rd table somewhere with user data? As for your second query - you have too many parens and quotes. Look at it.
  6. I wanted to see what you actually execute. That would be an echo of $insert As for the key - you have to decide what is the best key for your application. Are we more concerned with tracking tickets or tracking customers?
  7. Why do you have 3 fields in the new table? You only need the filename and the key value to connect. And I would suggest that the key field be the first record. And if that key is the primary key of the first table it should be first as well. As for the echo - show us the whole query that is supposed to be building the filenames table.
  8. Not sure what you want from me. You store things into this new table the same way you store other things into tables. You must define the new table with a key that matches the parent table so that you can connect the dots afterwards. If your #1 table has a column such as "customer_id" or "user_id" be sure to define a similarly namesd column in the #2 table and place that value into every record that you create with that customer's filenames Make sense?
  9. The way to do what? Make the table?
  10. Proper RDBMS structure dictates that you do NOT do it that way. You place the many portion of a one-to-many relationship (what you are doing) into a separate table, linked to the parent table. Then you write your queries against the 2 tables and loop thru the data. You will have multiple rows for a single key but you will have all of the details/filenames. One doesn't store arrays in a db. Nor does one create multiple columns in any table in order to store multiple "same" values onto one record.
  11. Your second question is not very clear. But - have you researched what happens when you use the IF NOT EXISTS clause in your create statement? Look it up.
  12. I'm thinking that the error about the 0 is because you are doing a "fetch_assoc" which provides named elements rather than numeric ones.
  13. Why don't you do some good old experimentation and see where it works? Or you could look it up in a manual.
  14. As shown above, how about this: $totals= gmdate("H:i:s",$row2['totals']);
  15. You don't. An if statement is not html. Form code is. ?? What are you talking about?
  16. First question is - have you checked if any rows are ever returned from your query? I don't see that happening in your current code, which is something that you should be doing. Then - if nothing else, try echoing out the query statement as well as taking a look at the source of your web page to see what the drop down looks like.
  17. What that html will do is return a 0 when the box is checked. It returns nothing at all if it is not checked. In fact the $_POST array will not have an element named 'ck1' in it unless the box is checked. As for returning a different value, perhaps you should be using a pair of radio buttons instead of a checkbox.
  18. And - echo "<option value='" . $row['course_id'] . "'>" . $row['course_name'] . "</option>";
  19. AS part of reading in the text file you can easily explode the row on those tab chars and then create your query input values.
  20. Glad you solved it. BTW - Here is a more 'proper' way to structure your code: define ("MAX_SIZE","5000"); function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $ext = substr($str,$i+1); return $ext; } //******** Begin main body ************ if (isset($updatephoto)) { $errors = 0; if($_SERVER["REQUEST_METHOD"] == "POST") { $image = $_FILES["profilephoto"]["name"]; $uploadedfile = $_FILES['profilephoto']['tmp_name']; if ($image) { $filename = stripslashes($_FILES['profilephoto']['name']); $extension = getExtension($filename); $extension = strtolower($extension); echo "test here $uploadedfile"; } } } Note: you don't bury a function def inside your logic. Of course for a script with multiple functions, I keep them at the end so that I don't have to wade thru them constantly when editing the script.
  21. They say 'undefined variable'. So - define them. If nothing else, simply set them to (quote)(quote), ie an empty value.
  22. I would definitely fix those errors before proceeding.
  23. I don't see an error message. Have you added any echos to be sure things are going the way you think they are?
  24. Show us your query. The way I would do this would be to use a mysql function to only select the yyyy-mm-dd portion of the timestamp and compare it (in the where clause) to the exact yyyy-mm-dd value you want to find. To be clear - I would do this IN the query statement itself.
  25. You need to set your timezone. It obviously is already incorrect. https://www.php.net/manual/en/function.date-default-timezone-set.php You will have to look up the correct name for your location
×
×
  • 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.