Typo? Your question has msyql_select_db
instead of mysql_select_db
- note the swap of the s
and y
in mysql
.
Tim
2010-04-19 15:25:01
Typo? Your question has msyql_select_db
instead of mysql_select_db
- note the swap of the s
and y
in mysql
.
$connect = mysql_connect('host', 'user', 'pass);
mysql_select_db('database', $connect);
That's how you connect to a database.
You also spelled mysql wrong.
Getting Fatal error: Call to undefined function msyql_select_db() with mysql_connect('localhost', 'name', 'pass'); <<msyql>>_select_db('dbname');
Arrows around the error.
I do not understand your question, but maybe this will help.
$session = mysql_connect('host','username','password');
mysql_select_db('database', $session);
$resultset = mysql_query('SELECT * FROM TABLE', $session);
$result = mysql_fetch_assoc($resultset);
Good luck...
May want to change localhost to '127.0.0.1' as well...I've had issues with that before.
Try:
$result= mysql_query('SELECT DISTINCT username FROM users');
$somethings= array();
while ($row= mysql_fetch_assoc($result)) {
$somethings[]= $row['something'];
}
Basically changing $results to $result.