Hi!!!
I Have one SQL in my script. And the result this SQL return 0 rows. But i have fields in my DataBase with this condition.
Maybe i error in SQL sintaxe.
Help me please!!!
The script is this:
$res = mysql_connect("localhost","escola");
if ($res)
{
$colocar = $_POST["D1"];
$sql = "Select * from Cursos Where DesCurso like('$colocar%') ";
$result = Mysql_db_query("escola","$sql",$res);
echo mysql_num_rows($result);
while ($present = mysql_fetch_array($result))
{
if ($present["DesCurso"] = $colocar)
{
$valor = $present["ValCurso"];
$quant = $present["ParCurso"];
echo $present["DesCurso"];
}
}
}
I´m try too this SQL:
$sql = "Select * from Cursos Where DesCurso = $colocar";
And nothing.
Thank´s
Miguel
Error in script
Moderator: General Moderators
-
kafka_loved_his_daddy
- Forum Newbie
- Posts: 3
- Joined: Tue Jul 22, 2003 3:06 am
- Location: austria
hello.
you may try and instead of mysql_db_query. once I had a similar problem. using the newer functions (mysql_db_query seems to be deprecated) worked fine.
cheers
marcel
you may try
Code: Select all
mysql_select_db("escola");Code: Select all
mysql_query($sql, $res);cheers
marcel