ScrewLooseSalad Posted March 8, 2013 Share Posted March 8, 2013 I'm trying to put some awkward codes into an array for processing, to get useful information from in the code, My problem is trying to get these codes from the database, can anyone Below is my code trying to get the codes from the database once it is outputting correctly I can then get on with the processing, any help getting an output I can then store into an array would be much appreciated! $query = "select * from orderlog where DeliverNote like '%$year%';"; $result = $db2->query($query); $num_results = $result->num_rows; $row = $result->fetch_assoc(); $i=1; while($i<=$num_results){ echo mysql_result($result,$i,"DeliverNote"); $i++; } Quote Link to comment https://forums.phpfreaks.com/topic/275409-trying-to-get-mysql_result-to-work/ Share on other sites More sharing options...
Solution Barand Posted March 8, 2013 Solution Share Posted March 8, 2013 $query = "select * from orderlog where DeliverNote like '%$year%';"; $result = $db2->query($query); while ($row = $result->fetch_assoc()) { echo $row['DeliverNote'] . '<br>'; } Quote Link to comment https://forums.phpfreaks.com/topic/275409-trying-to-get-mysql_result-to-work/#findComment-1417512 Share on other sites More sharing options...
ScrewLooseSalad Posted March 8, 2013 Author Share Posted March 8, 2013 (edited) $query = "select * from orderlog where DeliverNote like '%$year%';"; $result = $db2->query($query); while ($row = $result->fetch_assoc()) { echo $row['DeliverNote'] . '<br>'; } awesome! That has done the trick, thanks! Edited March 8, 2013 by ScrewLooseSalad Quote Link to comment https://forums.phpfreaks.com/topic/275409-trying-to-get-mysql_result-to-work/#findComment-1417518 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.