Posted by Dekka-X on 12/08/06 20:03
I want to call the following query from a function :
$sql2 = "SELECT * from session limit 1";
$result_thread = mysql_query($sql2, $conn);
while ($row3 = @mysql_fetch_array($result_thread)){
$sthread=$row3['thread'];
$slevel=$row3['level'];
}
The above code works fine in the program.
When I create a function I get the error:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link
resource
The function code I was trying to use is here. (bonus points for
telling me what idiotic mistake I'm making) >>>.
function search_session(){
$sql2 = "SELECT * from session limit 1";
$result_thread = mysql_query($sql2, $conn);
while ($row3 =
@mysql_fetch_array($result_thread)){
$sthread=$row3['thread'];
$slevel=$row3['level'];
return $sthread;
return $slevel;
}
}
Navigation:
[Reply to this message]
|