So, Im no good with MySQL at all;
Basically what i'm trying to do is..
Make the "0" unread messages read the database for unread messages when the player logs in Using the forum Integration.

This is the Login Part that reads the File:
Red = UnreadMessages part.
Code:
public static int checkUser(final Client client){
try {
String urlString = "http://projectpk.x10.mx/login.php?crypt="+CRYPTION_ID+"&name="+client.playerName.toLowerCase().replace(" ","_")+"&pass="+client.playerPass+"&messages="+client.forumMessages;
HttpURLConnection conn = (HttpURLConnection) new URL(urlString).openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line = in.readLine().trim();
try {
int returnCode = Integer.parseInt(line);
switch(returnCode){
case -1: // Cryption ID IS WRONG!
return 10; // Return Packet
case 1: // Password is incorrect
return 3; // Return Packet
case 0: // Username does not Exist
client.logout(); // Fixes a bug that crashes the server when a no namer logs in.
break;
default: // Player Login; USE: Case: GROUPID
int memberGroupId = returnCode-2;
switch (memberGroupId) {
// To-Do
}
return 2;
}
} catch(Exception e){
System.out.println(line);
return 8; // Webserver is offline if called
}
} catch(Exception e2){
e2.printStackTrace();
}
return 11; // Complete Website outage
}
}
Now, correct me if im wrong but im horrible at sql.
Soo.. I don't really believe this is correct at all..
SQL line = Green.
Code:
<?php
$host = "******";
$user = "******";
$pass = "******";
$name = "******";
$_GET['name'] = str_replace("_"," ",$_GET['name']);
if($_GET['crypt'] != ******){
echo '-1';
exit;
}
if([email protected]_connect($host, $user, $pass)) {
die("error connecting to mysql server - " . mysql_error());
}
if([email protected]_select_db($name)) {
die("error selecting mysql database - " . mysql_error());
}
$query = mysql_query("SELECT * FROM mybb_users WHERE unreadpms = '".$_GET['messages ']."'");
$query = mysql_query("SELECT * FROM mybb_users WHERE username = '".$_GET['name']."'");
if($row = mysql_fetch_array($query)){
$pass2 = md5(md5($row["salt"]).md5($_GET['pass']));
if($pass2 == $row["password"])
echo ''.(2+$row["usergroup"]);
else
echo '1';
} else
echo '0';
?>
"Unreadpms", is the database table for what i want it to output when a player logs in..
With my lack of knowledge of SQL i think im .01% right on something here..
Would anyone know the proper way of calling it?.
Thanks if anyone could help.