View Single Post
  #1 (permalink)  
Old 2006-03-18, 09:19 AM
Theavenger Theavenger is offline
Junior Member
 
Join Date: Mar 2006
Posts: 2
Theavenger
Default

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.


Code:
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 problmel is, i think this isnt one of the easiest methods 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
Reply With Quote
Sponsored Links