Jump to content

gw1500se

Members
  • Posts

    1,041
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by gw1500se

  1. This is probably a good place as any to start.
  2. Leave it in benanamen's format in your database. Change the query result to whatever format you need when you do the compare.
  3. Yep, now that I see the code properly posted with the formatter.
  4. You are trying to convert the literal string ADDRESS. You need ADDRESS to be a variable, hopefully, in the form xxx.xxx.xxx.xxx.
  5. Yep, the error is quite explicit. If you are having trouble seeing it echo $sql.
  6. inet_ntoa and inet_aton are MySQL functions. Use them in your queries.
  7. First please use the code icon (<>) and select PHP for your code. Second, where is that string coming from? It looks like the page is using GET not POST so you should me using $_GET. Third, never, ever put posted data directly into a query string. Use prepared statements only.
  8. OK, that is what I figured. You are not accessing the table you think you are. Post the code connecting to the database.
  9. Impossible. I would expect the error to be on 'area'.
  10. We've been here before. If you remove 'country' does it return the other values?
  11. I'm guessing when you changed to POST you did not change the array to $_POST which is why it didn't work.
  12. Incorrect. The page waits for a response from the server in background.
  13. Search engines are you friend. https://www.cloudways.com/blog/real-time-php-notification-system/
  14. I guess you need to be more explicit. I was assuming the exception was thrown by the Json_decode. post the exact error message and indicate to which line it refers.
  15. Did you var_dump the Json string before decoding it to make sure it is valid?
  16. Part of that problem may be the way you are storing it in you database. You should store it as unsigned int and use the MySQL functions INET_ATON and INET_NTOA in your queries.
  17. That is a MySQL error being returned by PDO. Since you claim the echo'ed string works in a MySQL shell you need to do some testing. First try to run it without setting that column. Perhaps the error will move or it may go away. Depending on which, try setting just that column in a separate query.
  18. Did you echo $sql1 then copy/paste that into the MySQL shell.
  19. That is because there is a problem with your query. You may need take that problem to the MySQL forum but essential t2.country does not exist in that column.
  20. Yes. $result is the data returned from the query where each element is a row from the query. The size of that array determines the size of your table. Although when you build the table you really don't need to know that. Jut add rows to the table until you run out of data. You can see what the array looks like with this: echo "<pre>"; print_r($result); echo "</pre>";
  21. This is a bit confusing but the first query seems unnecessary. You don't need a query just to find the count since later you query for the data. The last query does not want to be in a loop. After the execute do a fetch which gives you an array. The size of that array is the count for your table size.
  22. read this to see how to prepare and execute a query.
  23. I still don't understand this mysqli_query($sql1, $conn); mysqli_query($sql2, $conn); mysqli_query($sql3, $conn); when you haven't yet bound the variables.
  24. This code is confusing (please select PHP for your code next time). It appears you are running the query before you bind parameters. I don't seen how this can ever work.
×
×
  • 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.