Records wanted! Fetching data from tables - PHP
Despite the fact that we've discussed in previous articles the significant limitations of storing database records directly in a client's machine (specifically in RAM), there are some situations where this approach might be pretty useful. In small intranet environments, where the volume of data is rather limited, with applications running with controlled software and hardware resources, this method may find its place. However, anything else falling outside this category certainly should be considered inefficient.
$db=mysql_connect('dbhost','user','password') or die('Error connecting to the server'. mysql_error());
mysql_select_db('database') or die('Error selecting database');
$result=mysql_query('SELECT * FROM table') or die('Error performing query');