Hello all,
I am new and just signed up this forum. Wish you all good days !
I have a problem with php and mysql in my new website. The error msg is as below,
######You have successfuly registered to our site.Now please validate your password by visiting the URL you received in your email.Thank you.gaseste user sql 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 'sexuality<>' ' and sexuality='Hetero' and location<>' ' and loc./gallery/test111 ######
This error appeared when someone click 'submit' during new signup. This statement will stay awhile and directed to another page, everything work fine if I don't bother it . But it simply appear unprofessional . Below are some of the related scripts for your information .
mysql data file,
################################
DROP TABLE IF EXISTS blocaje;
CREATE TABLE blocaje (
id mediumint(8) unsigned NOT NULL auto_increment,
de_la mediumint(8) unsigned NOT NULL default '0',
pentru mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE KEY id (id),
KEY id_2 (id)
) TYPE=MyISAM;
--------------------------------------------------------
#
Table structure for table buddy
#
DROP TABLE IF EXISTS buddy;
CREATE TABLE buddy (
id smallint(5) unsigned NOT NULL auto_increment,
al_cui mediumint(8) unsigned NOT NULL default '0',
cine mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE KEY id (id),
KEY id_2 (id)
) TYPE=MyISAM;
--------------------------------------------------------
#
Table structure for table im
#
DROP TABLE IF EXISTS im;
CREATE TABLE im (
de_la_cine smallint(6) NOT NULL default '0',
pt_cine smallint(6) NOT NULL default '0',
text tinytext NOT NULL,
time_stamp datetime NOT NULL default '0000-00-00 00:00:00',
im tinyint(3) unsigned NOT NULL default '0'
) TYPE=MyISAM;
--------------------------------------------------------
#
Table structure for table ip_banning
#
DROP TABLE IF EXISTS ip_banning;
CREATE TABLE ip_banning (
ip varchar(15) NOT NULL default ''
) TYPE=MyISAM;
--------------------------------------------------------
#
Table structure for table match_finder
#
DROP TABLE IF EXISTS match_finder;
CREATE TABLE match_finder (
user_id mediumint(8) unsigned NOT NULL default '0',
sex set('Male','Female') NOT NULL default '',
sexuality varchar(20) NOT NULL default '',
location varchar(20) NOT NULL default '',
country varchar(30) NOT NULL default '',
zodia varchar(15) NOT NULL default '',
marital_status set('Married','Single') NOT NULL default '',
eyes_colour varchar(20) NOT NULL default '',
hair_colour varchar(20) NOT NULL default '',
weight tinyint(3) NOT NULL default '0',
weight_op char(1) NOT NULL default '',
height tinyint(3) NOT NULL default '0',
height_op char(1) NOT NULL default '',
music text NOT NULL,
age_min tinyint(3) NOT NULL default '0',
age_max tinyint(3) NOT NULL default '0',
KEY user_id (user_id)
) TYPE=MyISAM;
--------------------------------------------------------
#
Table structure for table mesaje
#
DROP TABLE IF EXISTS mesaje;
CREATE TABLE mesaje (
id mediumint(8) unsigned NOT NULL auto_increment,
de_la_cine mediumint(8) unsigned NOT NULL default '0',
pt_cine mediumint(8) unsigned NOT NULL default '0',
mesaj text NOT NULL,
sound varchar(15) NOT NULL default '',
data datetime NOT NULL default '0000-00-00 00:00:00',
ecard varchar(20) NOT NULL default '',
PRIMARY KEY (id),
UNIQUE KEY id (id),
KEY id_2 (id)
) TYPE=MyISAM;
--------------------------------------------------------
#
Table structure for table online
#
DROP TABLE IF EXISTS online;
CREATE TABLE online (
user_id mediumint(8) unsigned NOT NULL default '0',
real_time datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (user_id),
UNIQUE KEY user_id (user_id),
KEY user_id_2 (user_id)
) TYPE=MyISAM;
--------------------------------------------------------
#
Table structure for table pictures
#
DROP TABLE IF EXISTS pictures;
CREATE TABLE pictures (
id mediumint(8) unsigned NOT NULL auto_increment,
user_id mediumint(8) unsigned NOT NULL default '0',
nume varchar(15) NOT NULL default '',
PRIMARY KEY (id),
UNIQUE KEY id (id),
KEY id_2 (id)
) TYPE=MyISAM;
--------------------------------------------------------
#
Table structure for table sounds
#
DROP TABLE IF EXISTS sounds;
CREATE TABLE sounds (
id mediumint(8) unsigned NOT NULL auto_increment,
user_id mediumint(8) unsigned NOT NULL default '0',
nume varchar(15) NOT NULL default '',
PRIMARY KEY (id),
UNIQUE KEY id (id),
KEY id_2 (id)
) TYPE=MyISAM;
--------------------------------------------------------
#
Table structure for table users
#
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id mediumint(8) unsigned NOT NULL auto_increment,
nick varchar(10) NOT NULL default '',
password varchar(10) NOT NULL default '',
data datetime NOT NULL default '0000-00-00 00:00:00',
last_access datetime NOT NULL default '0000-00-00 00:00:00',
email varchar(25) NOT NULL default '',
view_profile smallint(5) unsigned NOT NULL default '0',
sex varchar(10) NOT NULL default '',
sexuality varchar(20) NOT NULL default '',
personal_ad text NOT NULL,
location varchar(20) NOT NULL default '',
country varchar(30) NOT NULL default '',
age tinyint(3) unsigned NOT NULL default '0',
birth_date varchar(8) NOT NULL default '',
zodia varchar(15) NOT NULL default '',
marital_status varchar(10) NOT NULL default '',
icq varchar(10) NOT NULL default '',
msn varchar(30) NOT NULL default '',
web varchar(40) NOT NULL default '',
eyes_colour varchar(20) NOT NULL default '',
hair_colour varchar(20) NOT NULL default '',
weight tinyint(3) unsigned NOT NULL default '0',
height tinyint(3) unsigned NOT NULL default '0',
music text NOT NULL,
partner text NOT NULL,
question text NOT NULL,
email_checked tinyint(3) unsigned NOT NULL default '0',
approvved tinyint(3) unsigned NOT NULL default '0',
newsletter tinyint(3) unsigned NOT NULL default '0',
upgraded tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE KEY id (id),
KEY id_2 (id)
) TYPE=MyISAM;
--------------------------------------------------------
#
Table structure for table vote_sec
#
DROP TABLE IF EXISTS vote_sec;
CREATE TABLE vote_sec (
user_id mediumint(8) unsigned NOT NULL default '0',
ip varchar(15) NOT NULL default '',
timestamp datetime NOT NULL default '0000-00-00 00:00:00'
) TYPE=MyISAM;
--------------------------------------------------------
#
Table structure for table voting
#
DROP TABLE IF EXISTS voting;
CREATE TABLE voting (
user_id mediumint(8) unsigned NOT NULL default '0',
total int(11) NOT NULL default '0',
total_votes mediumint(9) NOT NULL default '1',
KEY total (total)
) TYPE=MyISAM;
##########################################
whenever new users sign up the error msg will show,
##############You have successfuly registered to our site.Now please
validate your password by visiting the URL you received in your email.Thank
you.gaseste user sql 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 'sexuality<>' ' and sexuality='Hetero' and location<>' ' and
loc./gallery/222222#################
before directed to their account.
sign_up.php is as below,
<?
include ("config.php");
include ("functii_mail.php");
db_connect($dbserver,$dbuser,$dbpass,$dbname);
//variabile lang
global $sign_up_title;
include ($lang);
if (is_banned($REMOTE_ADDR))
{
echo "IP banned!";
exit();
}
function
inregistrare($nume,$password,$email,$sex,$sexuality,$personal_ad,$location,$
country,
$age ,$birth_date,$zodia,$marital_status,$icq,$msn
,$web,$eyes_colour="",$hair_colour="",$weight=0,$height=0,
$music,$partner ,$question,$newsletter )
{
$sql="insert into users values (' ','$nume','$password',now(),'
','$email',0,'$sex','$sexuality','$personal_ad',
'$location','$country',
$age ,'$birth_date','$zodia','$marital_status','$icq','$msn'
,'$web','$eyes_colour','$hair_colour','$weight',
'$height','$music','$partner' ,'$question',0,0,$newsletter,0)";
$res_logger = mysql_query ($sql);
if (!$res_logger)
{
echo "An error occured in the logger.: \n";
echo mysql_error();
return FALSE;
}
else
{
return true;
}
}
function password_check($password1,$password2)
{
if ($password1==$password2 )
{
return TRUE;
}
ELSE
{
return FALSE;
echo $password_diferit;
}
}
function nume_check($nume)
{
if (empty($nume) )
{
return FALSE;
echo "nume gol";
}
ELSE
{
return TRUE;
}
}
function email_check($email,$email1)
{
if ($email==$email1)
{
return TRUE;
}
ELSE
{
return FALSE;
echo $email_diferit;
}
}
function user_check($nume)
{
if (gaseste_user_by_nick($nume)==0)
{
return TRUE;
echo "same user";
}
else
{
return FALSE;
}
}
function terms_check($terms)
{
if (isset($terms)&& $terms==1)
{
return TRUE;
}
else
{
return FALSE;
echo "termeni";
}
}
if (isset($Submit))
{
if (password_check($password,$password1) && nume_check($username)
&&email_check($email,$email1) && user_check($username)&&
terms_check($terms))
{
if (empty($personal_ad))
{
$personal_ad="";
}
if (empty($location))
{
$location="";
}
if (empty($age))
{
$age=0;
}
and more........................but i think the error is within the codes.
Best Regards