kristapuciits Posted February 16, 2010 Report Share Posted February 16, 2010 Hi, man šeit ar šo php scripta rindiņu ir problēma. $sql = mysql_query(" SELECT lvl FROM $tbl_name WHERE nick = $_SESSION['nick'] "); Viņš raksta: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/a4285411/public_html/spele.php on line 29 Ko tas nozīmē, un ko man darīt? Paldies jau iepriekš! :) Quote Link to comment Share on other sites More sharing options...
chizijs Posted February 16, 2010 Report Share Posted February 16, 2010 $sql = mysql_query("SELECT lvl FROM '".$tbl_name."' WHERE nick = '".$_SESSION['nick']."'") or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
Pentiums Posted February 16, 2010 Report Share Posted February 16, 2010 $sql = mysql_query("SELECT lvl FROM ".$tbl_name." WHERE nick = '".$_SESSION['nick']."'"); Quote Link to comment Share on other sites More sharing options...
kristapuciits Posted February 16, 2010 Author Report Share Posted February 16, 2010 Liels paldies, bet varat palīdzēt vēl- 2 rindiņu kods ir šāds: $lvl = mysql_query("SELECT lvl FROM ".$tbl_name." WHERE nick = '".$_SESSION['nick']."'"); echo "Tavs limenis ir " . $lvl ; Bet viņš izvada nevis skaitli $lvl, bet kaut kādu Tavs limenis ir Resource id #6. Varat palīdzēt? :) Quote Link to comment Share on other sites More sharing options...
chizijs Posted February 16, 2010 Report Share Posted February 16, 2010 $lvl = mysql_fetch_array(mysql_query("SELECT lvl FROM ".$tbl_name." WHERE nick = '".$_SESSION['nick']."'")); echo "Tavs limenis ir " . $lvl['lvl'] ; Quote Link to comment Share on other sites More sharing options...
2easy Posted February 16, 2010 Report Share Posted February 16, 2010 echo "Tavs limenis ir " . mysql_result($lvl, 0); Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted February 16, 2010 Report Share Posted February 16, 2010 Es iesaku: $sql = "DELETE FROM $tbl_name WHERE 1=1"; mysql_query($sql); Un tad sākt domāt. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted February 16, 2010 Report Share Posted February 16, 2010 (edited) Nu ta' vienkārši nesajaucies ar " un '... Edited February 16, 2010 by daGrevis Quote Link to comment Share on other sites More sharing options...
2easy Posted February 16, 2010 Report Share Posted February 16, 2010 njaa cilvēki grib rakstīt skriptus, bet iemācīties programmēt gan ne... tas ir kā no sērijas "машину купил, права купил, а ездить не купил" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.