Hy there peeps,
ive been working with php/Sql now for my website and i keep getting more skilled at it. Half my site / script run on database retrieval & storage and for that i have been using the mysql_fetch_object retrieval method. Scripting like this.
mysql_connect("hostname","username","password");
mysql_select_db("databasename");
$query="select x from tablename";
$sql=mysql_query($query) or die (mysql_error());
while ($obj=mysql_fetch_object($sql)) {
$variable1=$obj->databasefield;
...
}
where x is needed data fields
The problem is, i think this isnt one of the easiest methods / scripts of retrieving data from a database to work with. Nor is this method easy to remember. So my question is, is there a more easier way to retrieve data in a database to work with.
Any help appreciated