Hey, I am running a custom SQL host on my computer, it runs and works fine but I cannot select things from it's database. First off, here is the code:
It loads the page (takes a bit to load it, because it is on a separate server) and it's just blank. Doesn't echo out anything. Just in case, here is the config.php file:
** Just so you know, I believe I added frihost to connect to the SQL server, but I am not exactly sure. Below are the steps I used to "allow" frihost. **
1. Went into PHPMYADMIN.
2. Selected my database.
3. On the top navigation bar, I clicked Privileges
4. The details are below:
Access 1:
User - root
Host - % (I believe this means anybody)
Type - global
Privileges - ALL PRIVILEGES
Grant - YES
Access 2:
User - root
Host - localhost
Type - global
Privileges - ALL PRIVILEGES
Grant - YES
Also, when I visit config.php the page is also blank, even when I echo something out on it. Alright, that is out of the way. So, I am wondering if there is something wrong with my code(s), or something wrong with the server (mine).
| Code: |
| <?php
include('members/config.php'); switch($_GET['page']) { default: echo "No username or password specified."; break; case 'login': $name = $_POST['name']; $pass = $_POST['pass']; $select = mysql_query("SELECT * FROM `users` WHERE `name` = '$name'"); $login = mysql_fetch_array($select); $mission = $login['mission']; echo "$mission"; break; } ?> |
It loads the page (takes a bit to load it, because it is on a separate server) and it's just blank. Doesn't echo out anything. Just in case, here is the config.php file:
| Code: |
| <?php
$connect = mysql_connect("24.36.122.119","root","passwordhere"); mysql_select_db(habbo) or die(mysql_error()); $user1 = mysql_query("SELECT * FROM `users` WHERE `name` = '$_SESSION[name]' AND `password` = '$_SESSION[password]'"); $user = mysql_fetch_array($user1); ?> |
** Just so you know, I believe I added frihost to connect to the SQL server, but I am not exactly sure. Below are the steps I used to "allow" frihost. **
1. Went into PHPMYADMIN.
2. Selected my database.
3. On the top navigation bar, I clicked Privileges
4. The details are below:
Access 1:
User - root
Host - % (I believe this means anybody)
Type - global
Privileges - ALL PRIVILEGES
Grant - YES
Access 2:
User - root
Host - localhost
Type - global
Privileges - ALL PRIVILEGES
Grant - YES
Also, when I visit config.php the page is also blank, even when I echo something out on it. Alright, that is out of the way. So, I am wondering if there is something wrong with my code(s), or something wrong with the server (mine).
