What is corret way to connect to MySQL?
- by sky
what is the correct way to connect to MySQL database without the mysql_fetch_assoc() error?
Getting [Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource] with
mysql_connect('localhost', 'name', 'pass'); mysql_select_db('dbname');
getting mysql_fetch_assoc() error without mysql_select_db any suggest?
CODE are:
$result= mysql_query('SELECT DISTINCT username FROM users');
$somethings= array();
while ($row= mysql_fetch_assoc($results)) {
$somethings[]= $row['something'];
}
?
var somethings= ;