Jump to content
Larry Ullman's Book Forums

Leaderboard

Popular Content

Showing content with the highest reputation since 03/17/11 in all areas

  1. The other day, I wanted to use the mysqli_connect function to connect to a DB on an external host that was not 'localhost'. Specifically, I was using XAMPP on a computer and was trying to connect to to a DB on a separate domain that I own, which is on a server maintained by my hosting company. I have (and know) all the necessary credentials for the DB, but I kept getting errors when trying to connect. I used the same user name, password and DB name as when its 'localhost', by for the host argument, I tried several combinations like domain-name.com, etc., but nothing worked. Does anyon
    3 points
  2. It's not all the privileges you need to grant but rather the ability to connect from other hosts, not localhost. Ideally, the connection script is on a fixed IP address and you can grant permissions to dbUser@'ACTUAL IP ADDRESS'. You have to make sure you do that first. The external connections/ports/etc. is a secondary, less common issue.
    3 points
  3. I hear you! Larry's the guru! He's the mastermind genius! You are a brainiac, too, HartleySan! Thanks again for the wonderful assistance! You are by no means a random dude, HartleySan; moreover, you are incredibly kind and extremely helpful--brilliant even--with a wonderful future in Web development! Thanks again!
    2 points
  4. Larry, maybe, but definitely not me. In fact, Larry corrects me all the time. I'm just a random dude hoping to work as a Web developer someday. Anyway, good luck.
    2 points
  5. I think you might be misunderstanding things a bit. To start with, it doesn't really matter where the actual DB files are stored on your localhost because you would never need to manipulate them directly. (If you really are curious though, they're in the xampp\mysql\data\ folder in Windows.) Instead, you should always use some sort of interface application, like phpMyAdmin, to manage and edit your DBs. By using phpMyAdmin, you can also easily import and export databases. In terms of the Web root folder, the one thing that you should probably place outside of it is the PHP file that ca
    2 points
  6. Hello, friends. Sorry to finish this post with some very basic questions, but I am going to be developing on localhost and then transferring over to a server maintained by a hosting company and had some elementary questions. First,please kindly note that I am wondering where I would place my MySQL databases on localhost to ensure that they are connected with the Web root folder. I'm not sure if I would save them in a specific folder or how to do so, if at all possible. As a matter of fact, I'm not even sure what folder the databases get saved to on my localhost in the first place.
    2 points
  7. You're welcome! Thanks for all the help you've provided to others over the years!
    2 points
  8. Okay. Good luck and let us know if you need any other help. As a suggestion, what many people do in this situation is create a service on your hosted site that will provide the necessary database access without directly connecting to MySQL remotely.
    2 points
  9. Originally, the user was using to connect to the DB had only the SELECT and UPDATE privileges, but I temporarily changed it so that the user had all privileges. Even then though, I had no luck in establishing a connection. Also, I appreciate your techie experts advice, but I don't know exactly what they mean by, "make sure that the MySQL server can accept external connections and that it is bound to the correct network interface." Could you possibly provide some more details about how to translate that into actions? Thanks. Also, it should be reiterated that I'm using a MySQL server pr
    2 points
  10. I get the following error: Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user 'xxx'@'xxx' (using password: YES) in C:\xampp\htdocs\xxx on line 3 Obviously, I have omitted the sensitive data with xxx, but you get the point. Also, I tried granting all privileges to the user, but I still get the same error.
    2 points
  11. What error are you getting? Have you tried GRANT ALL PRIVILEGES ON dbName.* TO dbUser @'%' IDENTIFIED BY 'dbPassword';
    2 points
  12. Yes, both versions are comparable with respect to validating the gender. To use the NULL coalescing operator in Script 2.4, you'd probably just write it like your version of Script 2.3 (note that you don't need the $gender = NULL in there though).
    1 point
  13. Not a problem to leave it as is. Thanks, though!
    1 point
  14. Yes, you're on the right path. And the concepts are a bit confusing. Remember that cookies are sent back and forth between the server and the browser. The $_COOKIES array is populated by the browser sending cookies back to the server. On the login page, the PHP script sets the cookie which means the cookie doesn't exist when the page is first loaded (i.e., it's not sent from the browser to the server upon login submission). So the logic has to factor in that the login page DOESN'T have the cookie, despite actually setting the cookie. Conversely, the cookie exists on the logout page when t
    1 point
  15. Ah, very clever (and something I never considered). Thanks a lot for that great idea, Larry!
    1 point
×
×
  • Create New...