0

Using print_r bellow simply prints Array ().

Why is this not working?

$conn = oci_connect("wwbms_admin", "wwbms_admin", "PDBQA");

$sql = "SELECT COUNTRY_ID, DESCRIPTION FROM COUNTRY";
$query_country = oci_parse($conn, $sql);

$list = array();

$result = oci_execute($query_country, OCI_DEFAULT);

while(($row = oci_fetch_assoc($query_country))) {
$items[$row['DESCRIPTION']] = $row['DESCRIPTION'];
}

print_r($list);

oci_close($conn);

Any help would be great, thanks.

1
  • 1
    I don't see $list ever being assigned values. Is this a typo or is something missing from above? Commented Apr 10, 2013 at 20:17

1 Answer 1

1

You set $list to an empty array(), then you run print_r on it. You never set it again. You're getting predictable results.

Maybe you meant to print_r($items);?

Sign up to request clarification or add additional context in comments.

1 Comment

I apologize, I am an idiot of course yes, Thank you for making me see the obvious :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.