Jump to content
Sign in to follow this  
MarkT

Weird MySQLi Error

Recommended Posts

Hi,

I have this code;

<?PHP include "./system/connect.php" ?>

<?PHP
$check = mysqli_query($con,"SELECT * FROM index");
$check2 = mysqli_fetch_array($check);
?>
However, on the website it gives this; Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/a5813772/public_html/index.html on line 13
Any ideas?
Thanks

Share this post


Link to post
Share on other sites

Fixed,

Index appears to be interpreted as something else.

Resolved by using ' ' around the word index in the query.

Share this post


Link to post
Share on other sites

Index is a reserved word in MySQL. You should wrap field names in backticks `, rather than quotation marks.

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...