how to make a mysql query and turn it into an array in php

74
January 24, 2021, at 03:20 AM

if I have a query that looks like this in php...

if ($result3 = $connuser->query("SELECT * FROM devices WHERE uid='".$username."'")){
    
}

How can I turn $result3 into an array? Also, separate question, I tried doing

echo $result3;

but it doesn't work. Is there a way to view $result3 so I can see what it looks like?

Answer 1

You can do:

$rows = [];
while($row = mysqli_fetch_array($result3))
{
    $rows[] = $row;
}
READ ALSO
MacOS Big Sur 11.1 can't launch eclipse installer

MacOS Big Sur 11.1 can't launch eclipse installer

I updated my MacOS to Big Sur 111 and I tried to download Eclipse IDE for Java Developers, and when I try to run the Eclipse Installer, it keep spinning at the Mac dock and nothing happens at all

125
InteractiveViewer image is zoomed in

InteractiveViewer image is zoomed in

My problem should be simple, but i'm stuck: i need to display the image of a map with a marker over it (that's why i'm using a stack) and this image can be zoomed and pannedThe only problem is, when i open the app the image is totally zoomed in, and i have to zoom out manually

95
Accept credit card and debit card payment using paypal in nodejs rest api

Accept credit card and debit card payment using paypal in nodejs rest api

I have used paypal-rest-sdk in my code the payment using paypal login working smoothly but now I want to pay using credit card and debit card without login to paypal

99
How to extract this text from this Website Scraping? BeatifulSoup

How to extract this text from this Website Scraping? BeatifulSoup

I'm trying to extract the string "No disponble" of this product, but im getting "none" or attribute text dont exists:

88