Jump to content

gw1500se

Members
  • Posts

    1,029
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by gw1500se

  1. Search engines are you friend. https://www.cloudways.com/blog/real-time-php-notification-system/
  2. 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.
  3. Did you var_dump the Json string before decoding it to make sure it is valid?
  4. 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.
  5. 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.
  6. Did you echo $sql1 then copy/paste that into the MySQL shell.
  7. 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.
  8. 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>";
  9. 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.
  10. read this to see how to prepare and execute a query.
  11. 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.
  12. 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.
  13. Do you mean a properly formatted email address (user@domain.com) or an email address that exists? The former is trivial with filter_var but the latter will require sending a confirmation and getting a reply.
  14. It is a bit hard to understand what you want but I think you are looking for str_replace.
  15. How about posting an image of the page you get and then explain what is wrong and what you want. To me this sounds like an HTML question not a PHP question.
  16. Then you are using a database (MySQL) to store the data? When you store the data, encrypt it.
  17. Define "capture." Are you talking about a way to store the info or to obtain it from a web page?
  18. The regular PHP hash is a one way encryption. I cannot be decrypted except via brute force.
  19. Now uid exists but you have not made its value an array (it is just a string) so there is no element named 'username'.
  20. Do you have session_start on each page?
  21. Did you echo $_SESSION['uid']['username']; to make sure it contains what you expect? Better yet: echo "<pre>"; var_dump($_SESSION); echo "</pre>";
  22. That is not double work. That is how uploads are intended to be handled. I'm not sure what you are asking of mac_gyver so I won't presume to answer for him but you do need a row for each file.
  23. PHP handles upload conflicts. Until you move the uploaded file it is not an issue. The moves can be done sequentially so simply keep a file with the current number and increment each time you move a file.
×
×
  • 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.