Jump to content

Recommended Posts

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

 

    $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 by ScrewLooseSalad
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.