0
$u_ress = mysql_query("SELECT * FROM `blackjack` WHERE `brukernavn`='$spiller->brukernavn' AND `by`='$by'");
$bj = mysql_fetch_object($qry);

This code wont work. It wil only show my $by, but its not what i want. I want it to get from blackjack where brukernavn is ( as it said) AND from by aswell.

How can i this?

4

2 回答 2

2
SELECT * FROM blackjack WHERE brukernavn='{$spiller->brukernavn}' AND by='$by'

请注意,在字符串中执行高级变量时,您必须使用括号。

于 2013-08-05T18:57:30.567 回答
0

试试下面的代码,

    echo "Query:=".$u_ress = ("SELECT * FROM blackjack WHERE `brukernavn` ='{$spiller->brukernavn}' AND `by` ='$by'");

$query = mysql_query($u_ress);

    //$bj = mysql_fetch_object($query);

不推荐使用 mysql_query。

于 2013-08-05T19:00:41.263 回答