Hi,
The other day I went through mysql.xml to edit out mysql_db_query then it
turned into modifying every example to be somewhat similar. Wasn't sure
to commit so did nothing :) Let me know if this sounds fine and don't
hesitate to be picky. echoing the fetched results, not sure the best way
to present that.
$conn = mysql_connect($host, $user, $pass);
mysql_select_db($database);
$query = "SELECT user_id,fullname FROM table";
$result = mysql_query($query);
if (!$result) {
echo 'Query Failed: ' . mysql_error();
exit;
}
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo 'User Id: ' . $row['user_id'] . "\n";
echo 'Full Name: ' . $row['fullname'] . "<br />\n";
}
mysql_free_result($result);
mysql_close($conn);
> > 2. one more word on the examples (from the english manual):
> > mysql_connect("mysql_host", "mysql_login", "mysql_password")
> > mysql_connect ("kraemer", "marliesle", "secret")
...
> > Using always the same syntax may improve understanding?
Having them consistant seems good although it _may_ make a few feel this
is the only way to do it. Although, not a major concern.
> > I prefer the first.
I used $variables, just did. 'strings' look fine too. CONSTANTS could
confuse some.
> > May I clean up exampels in the en-tree?
I did already but don't have to. Removed mysql_db_query from "See also"
too.
> No, you cannot remove my girl friends :)
Hmm, we need girlfriends too :)
regards,
Philip Olson