Jeannine
|
| Posted: 06/05/2003, 6:04 PM |
|
Sometimes I can run teh $db functoins fine, and at other times I simply cannot retrieve data this way. At those times I have to result to mysql_connect (etc.) or mssql_connect (etc) methods. I cannot seem to nail down what the problem is. It happens on both mySQL and MS SQL. I am using DSN connections.
Any ideas?
|
|
|
 |
glerma
|
| Posted: 06/05/2003, 6:51 PM |
|
Post an example code snippet that is sometimes not working...
|
|
|
 |
Jeannine
|
| Posted: 06/06/2003, 6:36 AM |
|
Orginally I had a complex query that did not run. I dummied it down considerably to this silly example. Still it did not work. Note that mysql_connect, mysql_dfetch etc. worked. So did dloookup...
here is a simple code snippet that did not work:
$thequery = "select * from states where state_id = 10";
$db->query($thequery);
$fldstate_id = $db->f("state_id");
--- $fldstate_id came back null.
|
|
|
 |
glerma
|
| Posted: 06/06/2003, 12:28 PM |
|
Are you creating a new $db connection object every time or are you just globalizing the original?
What I mean is when I need to do custom queries, I always create a new connection object.
Example: $db = new clsDB<Name>;
Then I do my normal query operations.
$db->query($sql);
After I'm all finished, then I cleanup the $db object.
unset($db);
Regards,
george
|
|
|
 |
|