I am using a group of classes to manipulate MySQL tables. I would like to be able to go through a table one line at a time to convert fields from all upper case to word upper case.
The problem I have, I think anyway, is that my result set from the first query is abandoned by the second query. I am wondering if there is an easy way around this? Thanks in advance.
Here is the code:
require("./classes/db_mysql.class");
require("./classes/connection.class");
$query = "select currentid, first, last from current";
$db=new connection;
$db->query($query);
While($db->next_record()) {
$first=ucwords(strtolower($db->Record[first]));
$last=ucwords(strtolower($db->Record[last]));
$currentid=$db->Record[currentid];
$query="UPDATE current set first='$first', last='$last' where currentid=$currentid";
$db->query($query);
echo $db->Record[first];
}