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

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

SQL Server - MyCTE query based on 24 hour period (next day) -

php - Using str_replace to translate a MySQL Table in html -