I Don't understand why can't make a SELECT!
Posted: Fri Feb 16, 2007 10:33 am
feyd | Please use
The problem is that in the variable $resultado nothing happens, i've already try a simple query like "SELECT * FROM user_data" and i get nothing in $resultado, i don't understand why! This means that the script always enter in the else part and never enter in the if part!! and the table have records in it 
The conection to DB is ok, i've already tested. Please help me understand why
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi
I'm making a script in php to get some values from a mysql DB but for a reason i don't understand why i can't get any select from it!!!!
here is my code:Code: Select all
<?php
$sql_select = "SELECT * FROM user_data WHERE cadn_user = '$cadn'";
$resultado = mysql_db_query($database_BD ,$sql_select);
if($resultado){
$id_user = mysql_result($resultado,0,0);
return $id_user;
}
else{
return 0;
}
?>The conection to DB is ok, i've already tested. Please help me understand why
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]