Warning: mysql_fetch_array() expects parameter 1 to be resource, string given in C:\\xampp\\htdocs\\test\\index.php on line 19
The input to mysql_fetch_Array is a resource, which is also the returned value from mysql_query. If you pass the value $sql to mysql_query(), it will not modify the parameter since it is passed by value. You have to assign the return value to another variable, which will be the desired resource.
$result = mysql_query($sql);
And then, pass the result parameter to mysql_fetch_array :
$row = mysql_fetch_array($result, MYSQL_BOTH)
Another important note: As you might see in all the related threads, read the red box in the php.net for these functions.
Use of this extension is discouraged. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:
mysqli_query() PDO::query()