View Full Version : weclient maker script prob
scolfer
June 25th, 2010, 08:35
Well my friend gave me a webclient maker script i got everything running but when u create a webclient and after it takes you to your client page i get this error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
can someone plz help me with this thank you.
this is the code from where i get the error from
<?php
$connect = mysql_connect('localhost', 'root', 'pass');
if(!$connect) {
echo 'Error connecting to database';
}
mysql_select_db('rspswc');
$getInfoQuery = mysql_query('SELECT name, ip, port FROM servers WHERE id='. $_GET['servers']) or die(mysql_error());
if(mysql_num_rows($getInfoQuery) > 0) {
$info = mysql_fetch_assoc($getInfoQuery);
?>
<center><FONT color="FF0000" size="7"><h3>
<?php
echo $info['name']
?>
</h3></FONT>
<center><applet name=client width=765 height=503 archive='bluurr_loader.jar' code='client.class'>
<PARAM name='java_arguments' value='-Xmx700m'>
<PARAM name='server_name' value='<?php echo $info['name']; ?>'>
<PARAM name='detail' value='low'>
<PARAM name='ip' value='<?php echo $info['ip']; ?>'>
<PARAM name='port' value='<?php echo $info['port']; ?>'>
<PARAM name='background_image' value=''>
<PARAM name='headicons' value='Prayer'></applet><center>
</center>
<center><FONT color="FF0000" size="7"><h3>
<?php
echo "Powered by runecross Clients";
?>
</h3></FONT>
</center>
</html>
<?php
} else {
echo 'Incorrect server ID';
}
?>
Matt`
June 25th, 2010, 08:49
That's a very generic error message.
Friss
June 25th, 2010, 15:52
Kinda need to post the code that is the error or we can't help you fix it.
Friss
June 25th, 2010, 21:18
$getInfoQuery = mysql_query('SELECT name, ip, port FROM servers WHERE id='. $_GET['servers'].'') or die(mysql_error());
Try that
scolfer
June 25th, 2010, 21:38
still dosent work
Friss
June 25th, 2010, 21:45
$serverid="{$_GET['servers']}";
$getInfoQuery = mysql_query("SELECT name, ip, port FROM servers WHERE id='$serverid'") or die(mysql_error());
scolfer
June 25th, 2010, 21:53
well i fix it this is the fixed code
('SELECT name, ip, port FROM servers WHERE id=" '. $_GET['servers'].' " ')
but now i get incorrect server id
scolfer
June 25th, 2010, 21:57
ive also added the code u gave me but i still get incorrect server id
Smudge
June 25th, 2010, 22:06
$connect = mysql_connect('localhost', 'root', 'pass');
Did you fill this in to connect to the database firstly? root is the user, it will be something like 'myhostname_admin' and password is self explanatory. Just check the obvious parts first. :D
Justin H
June 25th, 2010, 23:13
Please use the code tags next time. :(
$id_of_server = $_GET['servers'];
$getInfoQuery = mysql_query("SELECT name, ip, port FROM servers WHERE id='$id_of_server'") or die(mysql_error());
Edit: Never mind, noticed you already fixed your problem. ;)
Anthony`
June 25th, 2010, 23:25
Dont get into the habit of using the applet tag.
scolfer
June 25th, 2010, 23:26
yea my script connects to the database in the phpmyadmin it even shows the account i made,
Justin H
June 25th, 2010, 23:34
Try this instead of what you currently have, may fix the problem
$id_of_server = $_GET['servers'];
$getInfoQuery = mysql_query("SELECT name, ip, port FROM servers WHERE id='$id_of_server'") or die(mysql_error());
===============================
Add this right below $getInfoQuery
$check = mysql_num_rows($getInfoQuery);
then change
if(mysql_num_rows($getInfoQuery) > 0) {
to
if($check) {
scolfer
June 26th, 2010, 04:42
it still says incorrect server id
Justin H
June 26th, 2010, 04:58
Then I'm not sure whats wrong. Are you sure your entering the right ID that corresponds to the database? Make sure your entering in the URL like:
index.php?server=1
If you don't, there is no code to check and see if !$id_of_server (!$id_of_server is checking to see if server is empty) which leads to automatically say: "Incorrect server ID"
So, try this code:
<?php
$id_of_server = $_GET['servers'];
if(!$id_of_server) {
echo "Sorry, you haven't entered in an ID!";
}
elseif($error == 0)
{
$connect = mysql_connect('localhost', 'root', 'pass');
if(!$connect) {
echo 'Error connecting to database';
}
mysql_select_db('rspswc');
$getInfoQuery = mysql_query("SELECT name, ip, port FROM servers WHERE id='$id_of_server'") or die(mysql_error());
$check = mysql_num_rows($getInfoQuery);
if($check) {
$info = mysql_fetch_assoc($getInfoQuery);
?>
<center><FONT color="FF0000" size="7"><h3>
<?php
$error = 1;
echo $info['name']
?>
</h3></FONT>
<center><applet name=client width=765 height=503 archive='bluurr_loader.jar' code='client.class'>
<PARAM name='java_arguments' value='-Xmx700m'>
<PARAM name='server_name' value='<?php echo $info['name']; ?>'>
<PARAM name='detail' value='low'>
<PARAM name='ip' value='<?php echo $info['ip']; ?>'>
<PARAM name='port' value='<?php echo $info['port']; ?>'>
<PARAM name='background_image' value=''>
<PARAM name='headicons' value='Prayer'></applet><center>
</center>
<center><FONT color="FF0000" size="7"><h3>
<?php
echo "Powered by runecross Clients";
?>
</h3></FONT>
</center>
</html>
<?php
} else {
$error = 2;
echo 'Incorrect server ID';
}
?>
scolfer
June 26th, 2010, 08:45
nope still dosent work. dam ive been trying all day to fix and nothing :((((
cboy676
June 26th, 2010, 14:40
Okay i know you hate me for shit but i made the source code so OBV i know how to fix it.
<?php
$connect = mysql_connect('localhost', 'root', 'pass');
if(!$connect) {
echo 'Error connecting to database';
}
mysql_select_db('rspswc');
$getInfoQuery = mysql_query('SELECT name, ip, port FROM servers WHERE id='. $_GET['servers']) or die(mysql_error());
if(mysql_num_rows($getInfoQuery) > 0) {
$info = mysql_fetch_assoc($getInfoQuery);
?>
<center><FONT color="FF0000" size="7"><h3>
<?php
echo $info['name']
?>
</h3></FONT>
<center><applet name=client width=765 height=503 archive='bluurr_loader.jar' code='client.class'>
<PARAM name='java_arguments' value='-Xmx700m'>
<PARAM name='server_name' value='<?php echo $info['name']; ?>'>
<PARAM name='detail' value='low'>
<PARAM name='ip' value='<?php echo $info['ip']; ?>'>
<PARAM name='port' value='<?php echo $info['port']; ?>'>
<PARAM name='background_image' value=''>
<PARAM name='headicons' value='Prayer'></applet><center>
</center>
<center><FONT color="FF0000" size="7"><h3>
<?php
echo "Powered by runecross Clients";
?>
</h3></FONT>
</center>
</html>
<?php
} else {
echo 'Incorrect server ID';
}
?>
that is the current code.
Your error is here:
mysql_select_db('rspswc');
$getInfoQuery = mysql_query('SELECT name, ip, port FROM servers WHERE id='. $_GET['servers']) or die(mysql_error());
in your database make sure that the table "servers" is there if the table is not there then you must rename it to what is there.
See since this was my code i gave you i enabled anti-leach.java & protect.php on it.
Justin H
June 26th, 2010, 20:49
So his database was the problem? I thought we already asked him if the tables and information was correct. -.-
cboy676
June 26th, 2010, 20:52
So his database was the problem? I thought we already asked him if the tables and information was correct. -.-
Yes it is his database,
I do not know why i should help after he tryed to ddos me.
scolfer
June 27th, 2010, 03:13
i still get incorrect server id
Justin H
June 27th, 2010, 04:15
Alright, this is a code to basically check the output of the database. When it gives you the error of an incorrect ID, tell me what the information says when it echos out at the very last line.
<?php
$id_of_server = $_GET['servers'];
if(!$id_of_server) {
echo "Sorry, you haven't entered in an ID!";
}
elseif($error == 0)
{
$connect = mysql_connect('localhost', 'root', 'pass');
if(!$connect) {
echo 'Error connecting to database';
}
mysql_select_db('rspswc');
$getInfoQuery = mysql_query("SELECT name, ip, port FROM servers WHERE id='$id_of_server'") or die(mysql_error());
$check = mysql_num_rows($getInfoQuery);
while ($row = mysql_fetch_assoc($getInfoQuery))
{
$id_db = $row['id'];
}
if($check) {
$info = mysql_fetch_assoc($getInfoQuery);
?>
<center><FONT color="FF0000" size="7"><h3>
<?php
$error = 1;
echo $info['name']
?>
</h3></FONT>
<center><applet name=client width=765 height=503 archive='bluurr_loader.jar' code='client.class'>
<PARAM name='java_arguments' value='-Xmx700m'>
<PARAM name='server_name' value='<?php echo $info['name']; ?>'>
<PARAM name='detail' value='low'>
<PARAM name='ip' value='<?php echo $info['ip']; ?>'>
<PARAM name='port' value='<?php echo $info['port']; ?>'>
<PARAM name='background_image' value=''>
<PARAM name='headicons' value='Prayer'></applet><center>
</center>
<center><FONT color="FF0000" size="7"><h3>
<?php
echo "Powered by runecross Clients";
?>
</h3></FONT>
</center>
</html>
<?php
} else {
$error = 2;
echo 'Incorrect server ID';
echo "<br/>[CHECKING FOR ERRORS] - Lets make sure they match. ". $id_of_server ." : ". $id_db ."";
}
?>
cboy676
June 27th, 2010, 13:12
Alright, this is a code to basically check the output of the database. When it gives you the error of an incorrect ID, tell me what the information says when it echos out at the very last line.
<?php
$id_of_server = $_GET['servers'];
if(!$id_of_server) {
echo "Sorry, you haven't entered in an ID!";
}
elseif($error == 0)
{
$connect = mysql_connect('localhost', 'root', 'pass');
if(!$connect) {
echo 'Error connecting to database';
}
mysql_select_db('rspswc');
$getInfoQuery = mysql_query("SELECT name, ip, port FROM servers WHERE id='$id_of_server'") or die(mysql_error());
$check = mysql_num_rows($getInfoQuery);
while ($row = mysql_fetch_assoc($getInfoQuery))
{
$id_db = $row['id'];
}
if($check) {
$info = mysql_fetch_assoc($getInfoQuery);
?>
<center><FONT color="FF0000" size="7"><h3>
<?php
$error = 1;
echo $info['name']
?>
</h3></FONT>
<center><applet name=client width=765 height=503 archive='bluurr_loader.jar' code='client.class'>
<PARAM name='java_arguments' value='-Xmx700m'>
<PARAM name='server_name' value='<?php echo $info['name']; ?>'>
<PARAM name='detail' value='low'>
<PARAM name='ip' value='<?php echo $info['ip']; ?>'>
<PARAM name='port' value='<?php echo $info['port']; ?>'>
<PARAM name='background_image' value=''>
<PARAM name='headicons' value='Prayer'></applet><center>
</center>
<center><FONT color="FF0000" size="7"><h3>
<?php
echo "Powered by runecross Clients";
?>
</h3></FONT>
</center>
</html>
<?php
} else {
$error = 2;
echo 'Incorrect server ID';
echo "<br/>[CHECKING FOR ERRORS] - Lets make sure they match. ". $id_of_server ." : ". $id_db ."";
}
?>
Since it is my code i gave him, i can tell you that the code this is INCORRECT $id_of_server = MUST GO.
Rual take code from bluurrs maker and use dat just chagne some shit
scolfer
June 27th, 2010, 22:18
that didnt work either i guess theres no fix for this.
cboy676
June 27th, 2010, 22:20
that didnt work either i guess theres no fix for this.
Well the copy i dident sell you works :)
Justin H
June 27th, 2010, 22:34
Cboy, $id_of_server doesn't HAVE to go. And Scolfer, I'm not sure if your listening to us. Is your tables and rows CORRECT, in the database?
And you didn't even follow my directions. I'm not going to help anymore unless you actually help us help you.
cboy676
June 27th, 2010, 23:16
Cboy, $id_of_server doesn't HAVE to go. And Scolfer, I'm not sure if your listening to us. Is your tables and rows CORRECT, in the database?
And you didn't even follow my directions. I'm not going to help anymore unless you actually help us help you.
Yes very true.
He is not listening to us.
I am helping to be nice even tho he almost ddosed me.
scolfer
June 28th, 2010, 02:11
of coarse i was about to ddos you u fkin hacked my forums what am i sopposed to do laugh about it.
Club
June 30th, 2010, 13:11
TO HARD THAT CODE: d
Powered by vBulletin® Version 4.1.9 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.