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);

?>

that happens when you forget a closing bracket. you didn't end your last else statement.

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.

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
?>

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 .......

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);
}

?>

.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.