0

hello
i have received this error on line 28 the line 28 is this ?>


Parse error</b>: syntax error, unexpected $end in <b>/xxxx/xxxx/xxxxx/xxx/xxxxx.xxxx/public_html
/xxxxxx/ok/comprueba.php</b> on line <b>28</b><br />


here is the php file :

<?php

$mysql_host="xxxxxx.xxxxxx.com";
$mysql_user="anuncios";
$mysql_password="ganaras4";

$mysql_db = "suecia"; 

$conn = mysql_connect("$mysql_host","$mysql_user","$mysql_password")
or die("Could not connect : " . mysql_error());

mysql_select_db("$mysql_db",$conn)
 
or die("Select database failed"); 
 
$codigos = mysql_query("Select * from jos_cal  where code_usuario = '".@$_REQUEST['code']."' ",@$conn);

if (mysql_num_rows($conn)==0){

echo @$_REQUEST['code'].'  Codigos correcto ';

}else{

echo @$_REQUEST['code'].'  Codigos falso';

mysql_close($conn);

?>
4
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by maxbox
0

Simply close the last else statement:

}else{
echo @$_REQUEST['code'].' Codigos falso';
}

Also, I would blank out your mysql password. A simple googling could reveal the mysql host you use and allow someone to edit your mysql databases.

0

Looks like you're missing your closing curly brace. Change it to the following and try:

}else{

echo @$_REQUEST['code'].' Codigos falso';

mysql_close($conn);
} //<--Add this guy in
?>
0

Hello
ok i have missing to close with } but i have received this error now :

<b>Warning</b>: mysql_num_rows(): supplied resource is not a valid MySQL result resource in .......

0

capture picture from my db here

http://www.busca.se/1.jpg
http://www.busca.se/2.jpg
http://www.busca.se/3.jpg

comprueba.php

<?php

$mysql_host="xxxxx.xxxxxx.com";
$mysql_user="anuncios";
$mysql_password="xxxx";
$mysql_db = "suecia"; 

$conn = mysql_connect("$mysql_host","$mysql_user","$mysql_password")
or die("Could not connect : " . mysql_error());

mysql_select_db("$mysql_db",$conn)
 
or die("Select database failed"); 
 
$code = mysql_query("Select * from jos_call  where code = '".@$_REQUEST['nombre']."'",@$conn);

if (mysql_num_rows($conn)==0){

echo @$_REQUEST['nombre'].' - Codigo correcto';

}else{

echo @$_REQUEST['nombre'].' - Codigo falso';

mysql_close($conn);
}

?>

.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.