Code: Select all
$result=mysql_query ("SELECT id, firstname, lastname FROM characters",$link);
$x=mysql_result($result,1);
If not, what would I enter to get $x equal to firstname?
Code: Select all
$result=mysql_query ("SELECT id, firstname, lastname FROM characters",$link);
$x=mysql_result($result,1);
Code: Select all
$result=mysql_query ("SELECT id, firstname, lastname FROM characters",$link);
while($x=mysql_fetch_assoc($result)) {
echo $x['firstname'] . '<br />';
}
http://php.net/manual/en/book.mysqli.phpjameshutchings wrote:i) Where can I learn about mysqli?
Do what Chris showed you.jameshutchings wrote:ii) For now, what do I do to get id, firstname etc?
Your game will only have one character?jameshutchings wrote:I forgot to add that there should only be one result for this SELECT.