since mysql was changed having issues with video 2
Posted: Mon Dec 01, 2014 3:36 am
since php and mysql where updated your original dont work so i tried to revamp code to mysqli and i still cant get it to work my code is
<?php
include 'connect.php';
$playerinfo = mysqli_query($conn, "SELECT * from player WHERE name='Kronus'");
$playerinfo2 = mysqli_query($conn, $playerinfo) or die ("could not select players");
$playerinfo3 = mysqli_fetch_array($conn, $playerinfo2);
echo "Kronus's email is " . $playerinfo3['email'];
?>
but i get ( ! ) Warning: mysqli_query() expects parameter 2 to be string, object given in C:\wamp\www\Tutorial\test.php on line 5
i cant figure out where i am going wrong
<?php
include 'connect.php';
$playerinfo = mysqli_query($conn, "SELECT * from player WHERE name='Kronus'");
$playerinfo2 = mysqli_query($conn, $playerinfo) or die ("could not select players");
$playerinfo3 = mysqli_fetch_array($conn, $playerinfo2);
echo "Kronus's email is " . $playerinfo3['email'];
?>
but i get ( ! ) Warning: mysqli_query() expects parameter 2 to be string, object given in C:\wamp\www\Tutorial\test.php on line 5
i cant figure out where i am going wrong