problem with strings (SOLVED)
Posted: Mon Apr 06, 2015 6:47 pm
I have watched some youtube videos of Browser-Based MMORPG Tutorial, and on 4a video I encounter a problem.. this is the code:
<?php
include 'connect.php';
$playerinfo = "SELECT * FROM players WHERE username = 'player1'";
$playerinfo2 = mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3 = mysql_fetch_array($playerinfo2);
...etc...
and error says: could not get player stats!
So I assume there is error in line 3? Note to say: my db table is players and row is username, instead of just name as it is mention in tutorial.
connect.php is well set as I did manage to connect to my db and insert various names when registrateing. Also, I dont know is it important, but my host is not on coputer, I put files online and simple manage db and files on hosting server (easyer for me since I work from several different computers such as at home, work or my parents house).
So do I not see something obvius or is something else?
<?php
include 'connect.php';
$playerinfo = "SELECT * FROM players WHERE username = 'player1'";
$playerinfo2 = mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3 = mysql_fetch_array($playerinfo2);
...etc...
and error says: could not get player stats!
So I assume there is error in line 3? Note to say: my db table is players and row is username, instead of just name as it is mention in tutorial.
connect.php is well set as I did manage to connect to my db and insert various names when registrateing. Also, I dont know is it important, but my host is not on coputer, I put files online and simple manage db and files on hosting server (easyer for me since I work from several different computers such as at home, work or my parents house).
So do I not see something obvius or is something else?