capone Posted July 22, 2008 Share Posted July 22, 2008 This script work fine under php4 but not under php5. i think $db->next_record() is no longer supported under php 5 how can i rework this script to work under php 5? i tried $row=$db->fetch_assoc($row) in the while statement and i get Fatal error: Call to undefined method DB_Sql::fetch_assoc(). $db->query($sqlL); if($db->next_record()) { do { $fldid = $db->f("job_id"); $fldtitle = $db->f("title"); $flddesc = $db->f("j_desc"); $fldsal = $db->f("sal"); $fldedu = $db->f("edu"); $fldloc = $db->f("loc"); $fldreq = $db->f("req"); $fldbenef = $db->f("benef"); $fldcomp = $db->f("comp_id"); $tpl->set_var("id", $fldid); $tpl->set_var("jtype", tohtml($fldtitle)); $tpl->set_var("desc", tohtml($flddesc)); $tpl->set_var("sal", tohtml($fldsal)); $tpl->set_var("edu", $fldedu); $tpl->set_var("loc", tohtml($fldloc)); $tpl->set_var("req", tohtml($fldreq)); $tpl->set_var("bene", tohtml($fldbenef)); $tpl->set_var("comp", tohtml($fldcomp)); //$tpl->parse("RList", false); } while($db->next_record()); } Quote Link to comment https://forums.phpfreaks.com/topic/116057-script-works-php4-but-not-php5/ Share on other sites More sharing options...
corbin Posted July 23, 2008 Share Posted July 23, 2008 What errors are output? (If none are output, put error_reporting(E_ALL); and ini_set('display_errors', 'on'); at the top) Quote Link to comment https://forums.phpfreaks.com/topic/116057-script-works-php4-but-not-php5/#findComment-597135 Share on other sites More sharing options...
capone Posted July 23, 2008 Author Share Posted July 23, 2008 I don't get any errors just no data, the html columns show up just no data appears. I know my template code is working I get rows being output there just nothing in them.I made sure to populate the Dbase has anyone used mysql next record in their code with php5? Quote Link to comment https://forums.phpfreaks.com/topic/116057-script-works-php4-but-not-php5/#findComment-597738 Share on other sites More sharing options...
corbin Posted July 23, 2008 Share Posted July 23, 2008 Oh my bad. You told me the errors up above x.x. I'm apparently blind. Mysql next record? MSSQL you mean? Where did this Db_Sql object come from? Quote Link to comment https://forums.phpfreaks.com/topic/116057-script-works-php4-but-not-php5/#findComment-597763 Share on other sites More sharing options...
capone Posted July 23, 2008 Author Share Posted July 23, 2008 there is a php syntax for mysql interaction; mysql_next_record() pulls up next record in dbase it just doesn't seem to work under php5 as far as the object error -completely clueless Quote Link to comment https://forums.phpfreaks.com/topic/116057-script-works-php4-but-not-php5/#findComment-597941 Share on other sites More sharing options...
corbin Posted July 23, 2008 Share Posted July 23, 2008 http://www.sanisoft.com/phplib/manual/DB_SqlMethods.php Assuming that is the class you are using, I would say you should be using next_record() instead of fetch assoc.... Next_record is misleading to me though, since I think recordset, not row. Quote Link to comment https://forums.phpfreaks.com/topic/116057-script-works-php4-but-not-php5/#findComment-598066 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.