Jump to content

Coder2345

Members
  • Content count

    21
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Coder2345

  • Rank
    Newbie
  1. I'm not switching to any code? I'm letting you know that I have a different file on the same server that works if I use that code. That is the only code for that file. I used it when I first started coding (literally), in order to know if I was able to establish a connection with the server. I will try what you suggested. I'm just very confused as to why that file works and the one we are discussing doesn't. It's the same database and the same user with same password that has access to it. So it should work. The only difference is the table. Thank you for the suggestion. Trying it now.
  2. You see, both localhost and the servername connect when I use this code in a file; "Connected successfully" is the output. So I'm not sure why the same criteria isn't working in this case.
  3. I've tried 'localhost' and the servername. I get the same error no matter what. Should I try the IP or domain name?
  4. I was able to locate the error logs in cPanel;
  5. I tried this but it still says it cannot connect. Do you think the data type could be causing it not to work? id = int(6) FirstName = varchar(20) LastName = varchar(20) Age = int(3) Hometown = varchar(100) Job = archer(100) Or could it be to do with the xmlhttp not having a valid object? Thank for your help so far. It's appreciated.
  6. Yes, I did. I just can't seem to get it to work!
  7. From some digging around, it was suggested that xmlhttp needs to have a valid value (handle/object) before the line of code above can be executed properly. Does anyone have any suggestions as to what I should include in the code to solve this?
  8. I just used "ajax_demo" as an example. My actual database is called something different. My table is also called something different. To illustrate: database = my_DB table = ajax_demo column = id other columns = FirstName, LastName, Age, Hometown, Job
  9. I was missing one letter in the code. That solved that error issue. But now it's back to saying "could not connect" when I select a person from the list. I was advised to use localhost by a staff member from my web host, so maybe this is the issue? That is how I attempt to connect at present. A different PHP file from earlier practice looks like this: This code works, whereas the other one doesn't. Do you think localhost is the issue, as I had originally used www.servername.com instead of localhost when I wrote the code?
  10. I can't quite pinpoint the area where this might be occurring. A quick Google search of "xmlhttp is not defined" lead me to this: https://www.npmjs.com/package/xmlhttprequest Should I add that code to mine?
  11. This is the error I get when I try to select a person from the list; How does one solve this issue? Any help would be much appreciated.
  12. Thank you! I understand what you mean.
  13. I've tried what you suggested. "Could not connect:" is the response when a name is selected from the form. The same response occurs when the php page is run in the browser. Two questions; What is user referring to here? My table? Shouldn't user have quotes around it? Also, what is users referring to? Any help would be much appreciated.
  14. It seems so! Thanks for the help.
  15. Thank you for your input. I'll try what has been suggested.
×