MrBaseball34 Posted August 25, 2010 Share Posted August 25, 2010 I'm having trouble doing this: $niinssql = "SELECT description, nsn, niins_id FROM `niins` WHERE PARTNO = '".$partno."'"; $niinsresult = Db::getInstance()->Execute($niinssql); if($niinsresult) { while (list($description, $nsn, $niins_id)=DB::getInstance()->nextRow($niinsresult)) /********************************************************* // do something with $description, $nsn, $niins_id values /********************************************************* } // while (list($description, $nsn, $niins_id)=DB::getInstance()->getRow($niinsresult)) } // if($niinsresult) I'm getting all blank values even though I know there is at least one row.Can this be done or not? Link to comment Share on other sites More sharing options...
rocky Posted August 26, 2010 Share Posted August 26, 2010 I can get the next row to work, but not using the list syntax for some reason. Try using the following instead: $niinssql = "SELECT description, nsn, niins_id FROM `niins` WHERE PARTNO = '".$partno."'"; $niinsresult = Db::getInstance()->Execute($niinssql); if($niinsresult) { while ($row=Db::getInstance()->nextRow($niinsresult)) /********************************************************* // do something with $row['description'], $row['nsn'], $row['niins_id'] values /********************************************************* } // while ($row=DB::getInstance()->getRow($niinsresult)) } // if($niinsresult) Link to comment Share on other sites More sharing options...
MrBaseball34 Posted August 26, 2010 Author Share Posted August 26, 2010 I went with the foreach structure Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now