• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Need some help with a sqli_fetch_array error.

 
Greenhorn
Posts: 2
jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

First time poster here and have spent most of my day searching through forums and stack-overflow for a solution to my problem. I would have asked on stack overflow but whenever I ask questions there I always get down voted no matter what I ask.

Anyway, this is the error:

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in F:\Xampp\htdocs\PerfectoSculptures\updateCustomer.php on line 6

This is the code in which the warning points to:


The aim of this code is to update the records within my database, this is for an assessment at college and struggling to see where I am going wrong.

Thanks to anyone at all who can share their insight to this.

J
 
Marshal
Posts: 25456
65
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jordan, welcome to the Ranch!

I looked at the documentation for mysqli_query and it says:

Returns FALSE on failure. For successful SELECT, SHOW, DESCRIBE or EXPLAIN queries mysqli_query() will return a mysqli_result object. For other successful queries mysqli_query() will return TRUE.



So: you have a SELECT query. But you don't get a mysqli_result object returned. It follows that your SELECT query wasn't successful. You should find out why that is.
 
Jordan Woods
Greenhorn
Posts: 2
jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:Hi Jordan, welcome to the Ranch!

I looked at the documentation for mysqli_query and it says:

Returns FALSE on failure. For successful SELECT, SHOW, DESCRIBE or EXPLAIN queries mysqli_query() will return a mysqli_result object. For other successful queries mysqli_query() will return TRUE.



So: you have a SELECT query. But you don't get a mysqli_result object returned. It follows that your SELECT query wasn't successful. You should find out why that is.



Thank you for the speedy reply Paul!

I will go and have a look at everything now.

J
 
Dinner will be steamed monkey heads with a side of tiny ads.
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic