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++; } Link to comment https://forums.phpfreaks.com/topic/275409-trying-to-get-mysql_result-to-work/ Share on other sites More sharing options...
Barand Posted March 8, 2013 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>'; } 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 $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! 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
Archived
This topic is now archived and is closed to further replies.