SelectDB($sql_database); // The query format is that of mysql, so you don't need to learn any query // syntax with my class. All you need to do is figure out which query // function to use. // To get the results of a multiple row query, you would use something // similar to this: $sql->Query(select id, value from table order by id); for($i=0;$i<$sql->rows;$i++){ // for each row of results $sql->GetRow($i); // get the data for row $i // store row elements in variables if necessary $id=$sql->data['id']; $value=$sql->data['value']; // The $sql->data array is an associative array, but if you has a query // similar to "select id, value, something from table", you could also get // the values in the for loop using something like this: $id=$sql->data[0]; $value=$sql->data[1]; // do stuff with this row's data } // When you want to do a query when you know there will only be one row // returned, use the following function: $sql->QueryRow("select id,value from table where id = '$id'"); // To get the values, just use the data array $id=$sql->data['id']; $value=$sql->data['value']; // or $id=$sql->data[0]; $value=$sql->data[1]; // If you want to query for a specific cell in your database, you can do so // like this: $value=$sql->QueryItem("select value from table where id = '$id'"); // Each time you do a query, $sql->rows & $sql->data are reset, so // becareful when doing a loop based on query results with additional // queries inside the loop (unless you initialize another variable like // $tmp_sql). ?>