php - I mixed sql and sqli commands..but this gives errors..what is the correct code? -


this question has answer here:

there's error in piece of code..can care correct me?

$user_list=mysqli_query("select 'id','username', 'users' ");     while($run_user=mysqli_fetch_array($user_list)){         $user=$run_user['id'];         $username=$run_user['username'];         echo "<p><a href='send.php?user=$user'>$username</a></p>";         } 

from comments made below -

mysqli_query() expects @ least 2 parameters, 1 given in d:\wamp\www\2\send.php on line 44

just replace quotes backtick mysqli_query need connection in first parameter

 $user_list=mysqli_query(pass_your_connection_variable,"select `id`,`username` `users`"); 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -